Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

Delete admin API key

client.admin.organization.adminAPIKeys.delete(keyID, options?): AdminAPIKeyDeleteResponse { id, deleted, object }
DELETE
/organization/admin_api_keys/{key_id}

Delete an organization admin API key

Delete admin API key

import OpenAI from 'openai';

const client = new OpenAI({
  adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});

const adminAPIKey = await client.admin.organization.adminAPIKeys.delete('key_id');

console.log(adminAPIKey.id);
Response example
{
  "id": "key_abc",
  "object": "organization.admin_api_key.deleted",
  "deleted": true
}
Parameters
keyID: string

The ID of the API key to be deleted.

Returns
AdminAPIKeyDeleteResponse { id, deleted, object }
id: string
deleted: boolean
object: "organization.admin_api_key.deleted"
Returns Examples
Response example
{
  "id": "key_abc",
  "object": "organization.admin_api_key.deleted",
  "deleted": true
}