Create admin API key
POST/organization/admin_api_keys
Create an organization admin API key
Body ParametersJSON
name: string
Returns
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
formatint64
last_used_at: number
The Unix timestamp (in seconds) of when the API key was last used
formatint64
name: string
The name of the API key
object: string
The object type, which is always organization.admin_api_key
redacted_value: string
The redacted value of the API key
value: optional string
The value of the API key. Only shown on create.
Create admin API key
curl https://api.openai.com/v1/organization/admin_api_keys \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"name": "New Admin Key"
}'{
"id": "key_abc",
"created_at": 1711471533,
"last_used_at": 1711471534,
"name": "Administration Key",
"object": "organization.admin_api_key",
"owner": {
"id": "sa_456",
"created_at": 1711471533,
"name": "My Service Account",
"object": "organization.user",
"role": "owner",
"type": "user"
},
"redacted_value": "sk-admin...def",
"value": "sk-admin-1234abcd"
}Returns Examples
{
"id": "key_abc",
"created_at": 1711471533,
"last_used_at": 1711471534,
"name": "Administration Key",
"object": "organization.admin_api_key",
"owner": {
"id": "sa_456",
"created_at": 1711471533,
"name": "My Service Account",
"object": "organization.user",
"role": "owner",
"type": "user"
},
"redacted_value": "sk-admin...def",
"value": "sk-admin-1234abcd"
}