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

# Post apiv1userapi keys



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/user/api-keys
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.ekiden.fi/
    description: Production
  - url: https://api.staging.ekiden.fi/
    description: Staging
  - url: https://api.dev.ekiden.fi/
    description: Development
  - url: http://localhost:4020/
    description: Local
security: []
paths:
  /api/v1/user/api-keys:
    post:
      tags:
        - user
      operationId: create_api_key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
        required: true
      responses:
        '200':
          description: API key created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiKeyResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - bearer_auth: []
components:
  schemas:
    CreateApiKeyRequest:
      type: object
      required:
        - name
        - public_key
        - scopes
      properties:
        expires_at:
          type:
            - integer
            - 'null'
          format: int64
        name:
          type: string
        public_key:
          type: string
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/Scope'
    CreateApiKeyResponse:
      type: object
      required:
        - id
        - public_key
        - scopes
        - created_at
      properties:
        created_at:
          type: integer
          format: int64
        expires_at:
          type:
            - integer
            - 'null'
          format: int64
        id:
          type: string
        public_key:
          type: string
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/Scope'
    Scope:
      type: string
      enum:
        - full
        - read
        - trade
        - withdraw
        - admin
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````