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

# List Workspace API Keys

> List this workspace's API keys, newest first.

Only keys that can still authenticate. Key values are never returned -- only a hash
is stored.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json get /api/v1/workspaces/{workspace_id}/api-keys
openapi: 3.1.0
info:
  title: My Public API
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    x-group: Calls
  - name: workspaces
    x-group: Workspaces
  - name: agent-settings
    x-group: Agent Settings
  - name: agents
    x-group: Agents
  - name: simulation
    x-group: Simulation
  - name: traces
    x-group: Traces
  - name: providers
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/api-keys:
    get:
      tags:
        - workspaces
      summary: List Workspace API Keys
      description: >-
        List this workspace's API keys, newest first.


        Only keys that can still authenticate. Key values are never returned --
        only a hash

        is stored.
      operationId: list_workspace_api_keys_api_v1_workspaces__workspace_id__api_keys_get
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            description: Workspace ID. Find this in Workspace > General Settings.
            title: Workspace Id
          description: Workspace ID. Find this in Workspace > General Settings.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkspaceApiKeyResponse'
                title: >-
                  Response List Workspace Api Keys Api V1 Workspaces  Workspace
                  Id  Api Keys Get
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have access to this workspace.
          content:
            application/json:
              example:
                detail: User does not have access to workspace 42
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Workspace not found.
          content:
            application/json:
              example:
                detail: Workspace with ID 42 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    WorkspaceApiKeyResponse:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        last_four:
          type: string
          title: Last Four
        created_at:
          type: string
          format: date-time
          title: Created At
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
      type: object
      required:
        - id
        - name
        - last_four
        - created_at
      title: WorkspaceApiKeyResponse
      description: >-
        A workspace API key, without its value.


        The key itself is unrecoverable: only a hash is stored. ``last_four``
        exists so the

        UI can tell keys apart.
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````