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

# Create Api Key

> Create a new API key for the tenant.



## OpenAPI

````yaml post /api/v1/auth/api-keys
openapi: 3.1.0
info:
  title: Relay API
  description: Voice AI Artifact Detection Platform
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/auth/api-keys:
    post:
      tags:
        - auth
      summary: Create Api Key
      description: Create a new API key for the tenant.
      operationId: create_api_key_api_v1_auth_api_keys_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ApiKeyCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        scopes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Scopes
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      required:
        - name
      title: ApiKeyCreate
      description: Request schema for creating an API key.
    ApiKeyResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        key_prefix:
          type: string
          title: Key Prefix
        key:
          anyOf:
            - type: string
            - type: 'null'
          title: Key
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        created_at:
          type: string
          format: date-time
          title: Created At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
      type: object
      required:
        - id
        - name
        - key_prefix
        - scopes
        - created_at
      title: ApiKeyResponse
      description: Response schema for API key.
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````