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

# Create Api Key

> Create an API key scoped to the caller's organization.

The response carries the key secret. This is the only time the
secret is ever returned — store it immediately, because it cannot
be retrieved again.

Returns:
    The created key with its one-time secret.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json post /api-keys
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /api-keys:
    post:
      tags:
        - api-keys
      summary: Create Api Key
      description: |-
        Create an API key scoped to the caller's organization.

        The response carries the key secret. This is the only time the
        secret is ever returned — store it immediately, because it cannot
        be retrieved again.

        Returns:
            The created key with its one-time secret.
      operationId: api-keys-create_api_key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedApiKey'
        '403':
          description: >-
            Caller authenticated with an API key, or is not an organization
            administrator.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateApiKeyRequest:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
          description: Human-readable label identifying the key.
      type: object
      required:
        - name
      title: CreateApiKeyRequest
      description: |-
        Request body for minting a new API key.

        Attributes:
            name: Human-readable label identifying the key.
    CreatedApiKey:
      properties:
        id:
          type: string
          title: Id
          description: Unique key identifier.
        name:
          type: string
          title: Name
          description: Human-readable label supplied at creation.
        secret:
          type: string
          title: Secret
          description: >-
            The key secret. Returned only by this call and never retrievable
            afterwards.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the key was created.
      type: object
      required:
        - id
        - name
        - secret
        - created_at
      title: CreatedApiKey
      description: |-
        A freshly minted API key, including its one-time secret.

        Attributes:
            id: Unique key identifier.
            name: Human-readable label supplied at creation.
            secret: The key secret. Returned only by the creation call and
                never retrievable afterwards.
            created_at: When the key was created.
    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

````