> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get all API keys

> Lists metadata for your personal API keys and the team keys you can manage. Organization admins also receive every member's personal keys.

Personal keys include an `owner` object identifying the member the key belongs to. Organization admins see every member's personal keys in the listing; other roles see only their own.

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "keys": [
      {
        "prefix": "abcd1234",
        "name": "my-api-key",
        "type": "PERSONAL",
        "model_ids": null,
        "team_name": null,
        "owner": {
          "user_id": "1234abcd",
          "email": "member@example.com",
          "name": "Member Name"
        }
      },
      {
        "prefix": "efgh5678",
        "name": "ci-deploy-key",
        "type": "WORKSPACE_MANAGE_ALL",
        "model_ids": null,
        "team_name": "My Team",
        "owner": null
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml get /v1/api_keys
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/api_keys:
    get:
      summary: Lists API keys (metadata only, no plain text keys)
      description: >-
        Returns metadata for your personal API keys and the workspace and team
        API keys you can manage. Organization admins also receive every member's
        personal API keys, each with an owner identifying the member it belongs
        to.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIKeysV1'
      x-codeSamples:
        - lang: bash
          source: |
            curl --request GET \
            --url https://api.baseten.co/v1/api_keys \
            --header "Authorization: Bearer $BASETEN_API_KEY"
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/api_keys"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "GET",
                url,
                headers=headers,
                json={}
            )

            print(response.text)
components:
  schemas:
    APIKeysV1:
      description: A list of API keys.
      properties:
        keys:
          description: A list of API key information
          items:
            $ref: '#/components/schemas/APIKeyInfoV1'
          title: Keys
          type: array
      required:
        - keys
      title: APIKeysV1
      type: object
    APIKeyInfoV1:
      description: Represents the metadata of an API key.
      properties:
        prefix:
          description: The prefix of the API key
          title: Prefix
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Optional name for the API key
          examples:
            - my-api-key
          title: Name
        type:
          $ref: '#/components/schemas/APIKeyCategory'
          description: Type of the API key.
          examples:
            - PERSONAL
            - WORKSPACE_MANAGE_API_KEYS
            - WORKSPACE_EXPORT_METRICS
            - WORKSPACE_INVOKE
            - WORKSPACE_MANAGE_ALL
        model_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: >-
            List of model IDs to scope the API key to, only present if type is
            'WORKSPACE_EXPORT_METRICS' or 'WORKSPACE_INVOKE'
          examples:
            - - aaaaaaaa
          title: Model Ids
        team_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The name of the team associated with the API key
          title: Team Name
        owner:
          anyOf:
            - $ref: '#/components/schemas/APIKeyOwnerV1'
            - type: 'null'
          default: null
          description: The user who owns the API key. Only present for personal API keys.
      required:
        - prefix
        - type
      title: APIKeyInfoV1
      type: object
    APIKeyCategory:
      description: Enum representing the category of an API key.
      enum:
        - PERSONAL
        - WORKSPACE_MANAGE_ALL
        - WORKSPACE_EXPORT_METRICS
        - WORKSPACE_INVOKE
        - WORKSPACE_MANAGE_API_KEYS
      title: APIKeyCategory
      type: string
    APIKeyOwnerV1:
      description: The user who owns a personal API key.
      properties:
        user_id:
          description: Unique identifier for the user
          title: User Id
          type: string
        email:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Email address of the user
          title: Email
        name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Display name of the user
          title: Name
      required:
        - user_id
      title: APIKeyOwnerV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````