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

# Create API key



## OpenAPI

````yaml POST /v2/api-keys
openapi: 3.1.0
info:
  description: Deterministic, evidence-backed threat assessment API for machine consumers.
  title: Threat Investigator API v2
  version: 0.1.0
servers: []
security: []
paths:
  /v2/api-keys:
    post:
      tags:
        - API Keys
      summary: Create API key for the authenticated user
      operationId: create_api_key_v2_api_keys_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APIKeyCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIKeyCreateResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - BearerAuth: []
components:
  schemas:
    APIKeyCreateRequest:
      additionalProperties: false
      properties:
        expiresAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Expiresat
        expires_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Expires At
        name:
          anyOf:
            - maxLength: 255
              type: string
            - type: 'null'
          title: Name
        scopes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Scopes
      title: APIKeyCreateRequest
      type: object
    APIKeyCreateResponse:
      properties:
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        expires_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Expires At
        key_id:
          title: Key Id
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        scopes:
          items:
            type: string
          title: Scopes
          type: array
        secret:
          title: Secret
          type: string
        token:
          title: Token
          type: string
      required:
        - key_id
        - secret
        - token
      title: APIKeyCreateResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      description: Bearer <access_token>
      scheme: bearer
      type: http

````