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

# Create an API key. The plain-text key is returned exactly once.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/identity/api-keys
openapi: 3.1.0
info:
  title: Feather API
  description: >-
    Unified customer experience platform API. Manages identity, conversations,
    memory, agents, procedures, policies, model routing, knowledge bases,
    integrations, and runtime execution.
  version: 1.21.0
servers:
  - url: https://api-sandbox.featherhq.com
    description: Sandbox
  - url: http://localhost:8000
    description: Local dev
security: []
paths:
  /v1/identity/api-keys:
    post:
      tags:
        - identity
      summary: Create an API key. The plain-text key is returned exactly once.
      operationId: createApiKey
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreateRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyCreateResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ApiKeyCreateRequest:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      required:
        - name
      title: ApiKeyCreateRequest
    ApiKeyCreateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        key_prefix:
          type: string
          title: Key Prefix
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        is_active:
          type: boolean
          title: Is Active
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        created_at:
          type: string
          format: date-time
          title: Created At
        plain_text_key:
          type: string
          title: Plain Text Key
      type: object
      required:
        - id
        - name
        - key_prefix
        - scopes
        - is_active
        - last_used_at
        - expires_at
        - created_at
        - plain_text_key
      title: ApiKeyCreateResponse
      description: |-
        Returned exactly once on creation. ``plain_text_key`` is never persisted
        and never returned again — the caller must store it immediately.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response returned by all API error handlers.
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````