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

# Create Api Key Route



## OpenAPI

````yaml https://api.somya.ai/openapi.json post /v1/api-keys
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /v1/api-keys:
    post:
      tags:
        - api-keys
      summary: Create Api Key Route
      operationId: create_api_key_route_v1_api_keys_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APIKeyCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIKeyCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    APIKeyCreate:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - name
      title: APIKeyCreate
    APIKeyCreateResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          $ref: '#/components/schemas/APIKeyCreatedData'
      type: object
      required:
        - data
      title: APIKeyCreateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    APIKeyCreatedData:
      properties:
        api_key_id:
          type: string
          format: uuid
          title: Api Key Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        key:
          type: string
          title: Key
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - api_key_id
        - name
        - description
        - key
        - created_at
      title: APIKeyCreatedData
    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

````