NAME

OpenAPI::Client::OpenAI::Path::organization-admin_api_keys - Documentation for the /organization/admin_api_keys path.

OPERATIONS

GET /organization/admin_api_keys

admin-api-keys-list

$client->admin_api_keys_list({
    body => { ... },
});

List organization API keys

Retrieve a paginated list of organization admin API keys.

Path/query parameters

  • after (in query, optional, string)

  • order (in query, optional, string)

    Allowed values: asc, desc

    Default: asc

  • limit (in query, optional, integer)

    Default: 20

Responses

200 - A list of organization API keys.

Content-Type: application/json

Example:

{
   "data" : [
      "{\n  \"object\": \"organization.admin_api_key\",\n  \"id\": \"key_abc\",\n  \"name\": \"Main Admin Key\",\n  \"redacted_value\": \"sk-admin...xyz\",\n  \"created_at\": 1711471533,\n  \"last_used_at\": 1711471534,\n  \"owner\": {\n    \"type\": \"user\",\n    \"object\": \"organization.user\",\n    \"id\": \"user_123\",\n    \"name\": \"John Doe\",\n    \"created_at\": 1711471533,\n    \"role\": \"owner\"\n  }\n}\n"
   ],
   "first_id" : "key_abc",
   "has_more" : false,
   "last_id" : "key_xyz",
   "object" : "list"
}

POST /organization/admin_api_keys

admin-api-keys-create

$client->admin_api_keys_create({
    body => { ... },
});

Create an organization admin API key

Create a new admin-level API key for the organization.

Request body

Content-Type: application/json

Properties:

  • name (string, required)

Example:

{
   "name" : "New Admin Key"
}

Responses

200 - The newly created admin API key.

Content-Type: application/json

Example:

{
   "created_at" : 1711471533,
   "id" : "key_abc",
   "last_used_at" : 1711471534,
   "name" : "Administration Key",
   "object" : "organization.admin_api_key",
   "owner" : {
      "created_at" : 1711471533,
      "id" : "sa_456",
      "name" : "My Service Account",
      "object" : "organization.user",
      "role" : "owner",
      "type" : "user"
   },
   "redacted_value" : "sk-admin...def",
   "value" : "sk-admin-1234abcd"
}

SCHEMAS

AdminApiKey

Properties:

  • created_at (integer, required) - The Unix timestamp (in seconds) of when the API key was created

  • id (string, required) - The identifier, which can be referenced in API endpoints

  • last_used_at (anyOf)

  • name (anyOf) - The name of the API key

  • object (string, required) - The object type, which is always organization.admin_api_key

    Allowed values: organization.admin_api_key

  • owner (object, required)

  • redacted_value (string, required) - The redacted value of the API key

AdminApiKeyCreateResponse

See https://platform.openai.com/docs/api-reference for details.

ApiKeyList

Properties:

  • data (array of AdminApiKey, required)

  • first_id (anyOf)

  • has_more (boolean, required)

  • last_id (anyOf)

  • object (string, required)

    Allowed values: list

SEE ALSO

OpenAPI::Client::OpenAI::Path

COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.