Retrieves an API key in the project.

GET /organization/projects/{project_id}/api_keys/{key_id}

Path parameters

  • project_id string Required

    The ID of the project.

  • key_id string Required

    The ID of the API key.

Responses

  • 200 application/json

    Project API key retrieved successfully.

    Hide response attributes Show response attributes object
    • object string Required

      The object type, which is always organization.project.api_key

      Value is organization.project.api_key.

    • redacted_value string Required

      The redacted value of the API key

    • name string Required

      The name of the API key

    • 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

    • owner object Required
      Hide owner attributes Show owner attributes object
      • type string

        user or service_account

        Values are user or service_account.

      • user object

        Represents an individual user in a project.

        Hide user attributes Show user attributes object
        • object string Required

          The object type, which is always organization.project.user

          Value is organization.project.user.

        • id string Required

          The identifier, which can be referenced in API endpoints

        • name string Required

          The name of the user

        • email string Required

          The email address of the user

        • role string Required

          owner or member

          Values are owner or member.

        • added_at integer Required

          The Unix timestamp (in seconds) of when the project was added.

      • service_account object

        Represents an individual service account in a project.

        Hide service_account attributes Show service_account attributes object
        • object string Required

          The object type, which is always organization.project.service_account

          Value is organization.project.service_account.

        • id string Required

          The identifier, which can be referenced in API endpoints

        • name string Required

          The name of the service account

        • role string Required

          owner or member

          Values are owner or member.

        • created_at integer Required

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

GET /organization/projects/{project_id}/api_keys/{key_id}
curl \
 --request GET 'https://api.openai.com/v1/organization/projects/{project_id}/api_keys/{key_id}' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "object": "organization.project.api_key",
  "redacted_value": "string",
  "name": "string",
  "created_at": 42,
  "id": "string",
  "owner": {
    "type": "user",
    "user": {
      "object": "organization.project.user",
      "id": "string",
      "name": "string",
      "email": "string",
      "role": "owner",
      "added_at": 42
    },
    "service_account": {
      "object": "organization.project.service_account",
      "id": "string",
      "name": "string",
      "role": "owner",
      "created_at": 42
    }
  }
}