Returns a list of API keys in the project.

GET /organization/projects/{project_id}/api_keys

Path parameters

  • project_id string Required

    The ID of the project.

Query parameters

  • limit integer

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

    Default value is 20.

  • after string

    A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Responses

  • 200 application/json

    Project API keys listed successfully.

    Hide response attributes Show response attributes object
    • object string Required

      Value is list.

    • data array[object] Required

      Represents an individual API key in a project.

      Hide data attributes Show data 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

    • first_id string Required
    • last_id string Required
    • has_more boolean Required
GET /organization/projects/{project_id}/api_keys
curl \
 --request GET 'https://api.openai.com/v1/organization/projects/{project_id}/api_keys' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "object": "list",
  "data": [
    {
      "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
        }
      }
    }
  ],
  "first_id": "string",
  "last_id": "string",
  "has_more": true
}