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

# Create a new API key



## OpenAPI

````yaml post /v1/api-keys
openapi: 3.0.0
info:
  title: API Keys Management API
  version: 1.0.0
  description: API for managing API keys for user authentication
servers: []
security: []
paths:
  /v1/api-keys:
    post:
      tags:
        - API Keys
      summary: Create a new API key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreate'
      responses:
        '201':
          description: API key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyWithSecretResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ApiKeyCreate:
      type: object
      required:
        - name
        - expires_at
      properties:
        name:
          type: string
          description: The name of the API key
        expires_at:
          type: string
          format: date-time
          description: The expiration date and time of the API key
    ApiKeyWithSecretResponse:
      allOf:
        - $ref: '#/components/schemas/ApiKeyResponse'
        - type: object
          properties:
            secret:
              type: string
              description: The full API key secret (only returned on creation)
    ApiKeyResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        last_used_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - ACTIVE
            - EXPIRED
            - REVOKED
        name:
          type: string
        prefix:
          type: string
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
        message:
          type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````