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

# Create inference key

> Mint an inference key with a management key



## OpenAPI

````yaml api-reference/platform.json POST /api/v1/management/api-keys
openapi: 3.1.0
info:
  title: Subconscious platform API
  version: 1.0.0
  description: >-
    Management keys and organization usage on the Subconscious platform.
    Inference stays on https://api.subconscious.dev/v1.
servers:
  - url: https://platform.subconscious.dev
security: []
paths:
  /api/v1/management/api-keys:
    post:
      summary: Create an inference key
      description: >-
        Mints an inference key for the organization that owns the management
        key. The `key` secret is returned once. Later delete calls use
        `keyPrefix`. A management key cannot run inference. Inference keys
        presented here are rejected.
      operationId: createInferenceKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Display name for the inference key. Must be non-empty after
                    trimming and at most 255 characters.
                  example: tenant-42
      responses:
        '201':
          description: Inference key created. `key` is shown only in this response.
          content:
            application/json:
              schema:
                type: object
                required:
                  - apiKey
                properties:
                  apiKey:
                    type: object
                    required:
                      - id
                      - name
                      - key
                      - keyPrefix
                      - createdAt
                    properties:
                      id:
                        type: string
                        description: Platform id of the key.
                      name:
                        type: string
                      key:
                        type: string
                        description: >-
                          Inference secret (`sk-gw-...`). Store it now. It is
                          not returned again.
                      keyPrefix:
                        type: string
                        description: Prefix used by the delete endpoint.
                      createdAt:
                        type: string
                        format: date-time
              example:
                apiKey:
                  id: 5f0c8a1e-2b4d-4c7e-9a10-6d3f2e1b0c9a
                  name: tenant-42
                  key: sk-gw-...
                  keyPrefix: a1b2c3d4
                  createdAt: '2026-09-30T21:40:00.000Z'
        '400':
          description: >-
            The body is not JSON, `name` is missing or longer than 255
            characters, or the organization is at its inference-key limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                name:
                  value:
                    error: Body must include a non-empty "name" (max 255 chars)
                limit:
                  value:
                    error: Maximum number of keys is 10
        '401':
          description: Missing or inactive management key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The key is not a management key, or the organization does not have
            closed-beta access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                notManagement:
                  value:
                    error: Key is not a management API key
                closedBeta:
                  value:
                    error: Closed-beta access is required
        '500':
          description: The key could not be created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl https://platform.subconscious.dev/api/v1/management/api-keys \
              -H "Authorization: Bearer sk-mgmt-..." \
              -H "Content-Type: application/json" \
              -d '{"name": "tenant-42"}'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key in the Authorization header. Management endpoints require a
        management key (`sk-mgmt-...`). GET /api/v1/usage requires an inference
        key (`sk-gw-...`).
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Same key as bearer auth, passed in the X-API-Key header.

````