Skip to content
Primary navigation

Retrieve admin API key

$ openai admin:organization:admin-api-keys retrieve
GET/organization/admin_api_keys/{key_id}

Retrieve a single organization API key

ParametersExpand Collapse
--key-id: string

The ID of the API key.

ReturnsExpand Collapse
admin_api_key: object { id, created_at, expires_at, 5 more }

Represents an individual Admin API key in an org.

id: string

The identifier, which can be referenced in API endpoints

created_at: number

The Unix timestamp (in seconds) of when the API key was created

expires_at: number

The Unix timestamp (in seconds) of when the API key expires

object: "organization.admin_api_key"

The object type, which is always organization.admin_api_key

owner: object { id, created_at, name, 3 more }
id: optional string

The identifier, which can be referenced in API endpoints

created_at: optional number

The Unix timestamp (in seconds) of when the user was created

name: optional string

The name of the user

object: optional string

The object type, which is always organization.user

role: optional string

Always owner

type: optional string

Always user

redacted_value: string

The redacted value of the API key

last_used_at: optional number

The Unix timestamp (in seconds) of when the API key was last used

name: optional string

The name of the API key

Retrieve admin API key

openai admin:organization:admin-api-keys retrieve \
  --admin-api-key 'My Admin API Key' \
  --key-id key_id
{
  "object": "organization.admin_api_key",
  "id": "key_abc",
  "name": "Main Admin Key",
  "redacted_value": "sk-admin...xyz",
  "created_at": 1711471533,
  "last_used_at": 1711471534,
  "owner": {
    "type": "user",
    "object": "organization.user",
    "id": "user_123",
    "name": "John Doe",
    "created_at": 1711471533,
    "role": "owner"
  }
}
Returns Examples
{
  "object": "organization.admin_api_key",
  "id": "key_abc",
  "name": "Main Admin Key",
  "redacted_value": "sk-admin...xyz",
  "created_at": 1711471533,
  "last_used_at": 1711471534,
  "owner": {
    "type": "user",
    "object": "organization.user",
    "id": "user_123",
    "name": "John Doe",
    "created_at": 1711471533,
    "role": "owner"
  }
}