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

# Create an api key

> Provision a key, returning ``{"api_key", "key_fingerprint"}``. The raw ``sk-…``
``api_key`` is surfaced ONCE; ``key_fingerprint`` is the key's immutable per-mint
identity a caller binds a hook against so the binding survives only this exact mint.



## OpenAPI

````yaml /openapi.json post /api/auth/api-keys
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 0.1.1
servers: []
security: []
paths:
  /api/auth/api-keys:
    post:
      tags:
        - access-control
      summary: Create an api key
      description: >-
        Provision a key, returning ``{"api_key", "key_fingerprint"}``. The raw
        ``sk-…``

        ``api_key`` is surfaced ONCE; ``key_fingerprint`` is the key's immutable
        per-mint

        identity a caller binds a hook against so the binding survives only this
        exact mint.
      operationId: post_api_auth_api_keys
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                required:
                  - data
                type: object
          description: Success.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Malformed request.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ApiKeyCreate:
      description: >-
        Create an api key for ``user_id`` with a scope set and an optional jq

        authorization condition (inline ``condition`` or stored
        ``condition_id``).
      properties:
        condition:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Condition
        condition_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Condition Id
        condition_kwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Condition Kwargs
        description:
          minLength: 1
          title: Description
          type: string
        owner_user_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Owner User Id
        policy_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Policy Data
        scopes:
          items:
            type: string
          title: Scopes
          type: array
        user_id:
          minLength: 1
          title: User Id
          type: string
      required:
        - user_id
        - description
        - scopes
      title: ApiKeyCreate
      type: object
    Error:
      properties:
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````