Sample - OpenAI API
GET/organization/projects/{project_id}/api_keys/{api_key_id}

Retrieve a project API key

Retrieves a specific API key in an organization project. Provide both project_id and api_key_id to inspect the key's redacted value, metadata, expiration, usage, and ownership.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
project_idstringrequired
The unique identifier of the project containing the API key.
api_key_idstringrequired
The unique identifier of the API key to retrieve.

1 status code
200Returns the project API key with its redacted value, name, timestamps, identifier, owner access status, and ownership details.
objectstringrequired
The object type, which is always `organization.project.api_key`
Allowed:organization.project.api_key
redacted_valuestringrequired
The redacted value of the API key
namestringrequired
The name of the API key
created_atintegerrequired
The Unix timestamp (in seconds) of when the API key was created
expires_atintegeroptional
The Unix timestamp (in seconds) when the API key expires, or null if it does not expire.
last_used_atintegerrequired
The Unix timestamp (in seconds) of when the API key was last used.
idstringrequired
The identifier, which can be referenced in API endpoints
owner_project_accessstringrequired
Whether the API key's owner currently has effective access to the project.
Allowed:activeinactive
ownerobjectrequired

Error handling

project_id must identify the project containing the key, and api_key_id must identify the API key to retrieve. The response exposes only the key's redacted value rather than its secret value.