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

# Create a workspace API key

> Creates a new workspace-scoped API key for public agent API access.



## OpenAPI

````yaml /openapi/traseq-public-agent.json post /workspaces/{workspaceId}/api-keys
openapi: 3.0.0
info:
  title: Traseq Agent API
  description: >-
    Public, versioned API for external integrations and AI agents. Includes API
    key management and machine-readable OpenAPI.
  version: 1.0.0
  contact: {}
servers: []
security: []
tags:
  - name: API Keys
    description: Workspace-scoped API key management
  - name: Agent API
    description: Public API for external integrations and AI agents
paths:
  /workspaces/{workspaceId}/api-keys:
    post:
      tags:
        - API Keys
      summary: Create a workspace API key
      description: Creates a new workspace-scoped API key for public agent API access.
      operationId: PublicOpenApiApiKeysController_create
      parameters:
        - name: workspaceId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  maxLength: 100
                  example: agent-prod
                description:
                  type: string
                  maxLength: 500
                  example: Production key for autonomous portfolio research agent
                scopes:
                  type: array
                  items:
                    type: string
                    enum:
                      - workspace_read
                      - system_strategies_read
                      - strategies_read
                      - strategies_write
                      - backtests_read
                      - backtests_write
                  example:
                    - workspace_read
                    - system_strategies_read
                    - strategies_read
                    - strategies_write
                    - backtests_read
                    - backtests_write
                expiresAt:
                  type: string
                  format: date-time
                  example: '2026-12-31T23:59:59.000Z'
      responses:
        '201':
          description: API key created. Plaintext apiKey is returned once.
      security:
        - supabase-jwt: []
components:
  securitySchemes:
    supabase-jwt:
      scheme: bearer
      bearerFormat: JWT
      type: http

````