If you need to find the user and organizations associated with an API key, you can do so by calling the https://api.openai.com/v1/me endpoint, using the API key as the Bearer token.
Here's an example of what this would look like as a cURL call:
curl https://api.openai.com/v1/me \
-H "Authorization: Bearer $OPENAI_API_KEY"
This will return an object with the following structure (non-critical elements removed for convenience):
{
"object": "user",
"id": "user-1234",
"email": "user@yourcompany.com",
"name": "Users Name",
...
"orgs": {
"object": "list",
"data": [
{
"object": "organization",
"id": "org-abcd",
"title": "Org 1 Name",
...
},
{
"object": "organization",
"id": "org-1234",
"title": "Org 2 Name",
...
}
]
You can use this information to perform whatever follow up actions may be needed (for example: in the case of a leaked API key, contact the owner of the API key, and ask them to delete the key from here: https://platform.openai.com/account/api-keys).