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

# Create Api Key

> Create a new API key for programmatic access.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/auth/api-keys
openapi: 3.1.0
info:
  title: faces
  version: 0.101.0
servers: []
security: []
paths:
  /v1/auth/api-keys:
    post:
      tags:
        - API Keys
      summary: Create Api Key
      description: Create a new API key for programmatic access.
      operationId: create_api_key_v1_auth_api_keys_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAPIKeyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAPIKeyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateAPIKeyRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
          description: Label for the key. At most 255 characters.
        expires_in_days:
          anyOf:
            - type: integer
              maximum: 36500
              minimum: 0
            - type: 'null'
          title: Expires In Days
          description: Days until the key expires. Omit or 0 for a key that never expires.
        scopes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Scopes
          default:
            - v1:*
        budget_usd:
          anyOf:
            - type: number
              maximum: 999999
              minimum: 0
            - type: 'null'
          title: Budget Usd
          description: Lifetime spend cap in USD. Omit for no cap.
        allowed_face_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Face Ids
        allowed_llm_models:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Llm Models
      additionalProperties: false
      type: object
      title: CreateAPIKeyRequest
    CreateAPIKeyResponse:
      properties:
        key:
          type: string
          title: Key
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        created_at:
          type: string
          format: date-time
          title: Created At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        key_prefix:
          type: string
          title: Key Prefix
        budget_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Budget Usd
        spent_usd:
          type: number
          title: Spent Usd
        allowed_face_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Face Ids
        allowed_llm_models:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Llm Models
      type: object
      required:
        - key
        - id
        - name
        - created_at
        - expires_at
        - key_prefix
        - budget_usd
        - spent_usd
        - allowed_face_ids
        - allowed_llm_models
      title: CreateAPIKeyResponse
    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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.