> ## 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.

# Delete inference key

> Revoke an inference key by its prefix



## OpenAPI

````yaml api-reference/platform.json DELETE /api/v1/management/api-keys/{keyPrefix}
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/{keyPrefix}:
    delete:
      summary: Delete an inference key
      description: >-
        Revokes the inference key at the gateway and deactivates it. Requests
        that still present the deleted key fail. The lookup is limited to active
        inference keys in the management key's organization. Management keys
        cannot be deleted here.
      operationId: deleteInferenceKey
      parameters:
        - $ref: '#/components/parameters/keyPrefix'
      responses:
        '200':
          description: The key was revoked.
          content:
            application/json:
              schema:
                type: object
                required:
                  - revoked
                  - id
                  - keyPrefix
                properties:
                  revoked:
                    type: boolean
                    enum:
                      - true
                  id:
                    type: string
                  keyPrefix:
                    type: string
              example:
                revoked: true
                id: 5f0c8a1e-2b4d-4c7e-9a10-6d3f2e1b0c9a
                keyPrefix: a1b2c3d4
        '401':
          description: Missing or inactive management key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key is not a management key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No active inference key in this organization matches the prefix.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: No active API key with prefix a1b2c3d4
        '500':
          description: The key could not be deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            The gateway did not revoke the key. The platform key stays active.
            Retry the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl -X DELETE
            https://platform.subconscious.dev/api/v1/management/api-keys/a1b2c3d4
            \
              -H "Authorization: Bearer sk-mgmt-..."
components:
  parameters:
    keyPrefix:
      name: keyPrefix
      in: path
      required: true
      schema:
        type: string
        example: a1b2c3d4
      description: Prefix returned when the inference key was created.
  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.

````