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

# Delete API Key

> Revoke an OpenLIT API key.



## OpenAPI

````yaml DELETE /api/api-key/{id}
openapi: 3.0.0
info:
  title: API Keys API
  description: >-
    Create, list, update the feature access of, and delete OpenLIT API keys.
    These endpoints require a signed-in OpenLIT session; Bearer API keys are
    rejected with `403`, so a key can't list, create, change, or delete keys.
  version: 1.0.0
servers:
  - url: http://localhost:3000
security: []
paths:
  /api/api-key/{id}:
    delete:
      summary: Delete API Key
      description: >-
        Revokes an API key. Applications using it stop authenticating
        immediately. Requires a signed-in session.
      operationId: deleteApiKey
      parameters:
        - $ref: '#/components/parameters/ApiKeyId'
      responses:
        '200':
          description: The key was deleted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - sessionAuth: []
components:
  parameters:
    ApiKeyId:
      name: id
      in: path
      required: true
      description: The API key ID (not the secret value).
      schema:
        type: string
  responses:
    BadRequest:
      description: Invalid JSON, an invalid name, or an invalid list of features.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The request used a Bearer API key, the caller lacks the required
        permission, the edition or license doesn't support restricting keys, or
        the caller's role doesn't include a requested feature.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    sessionAuth:
      type: apiKey
      in: cookie
      name: next-auth.session-token
      description: Signed-in OpenLIT browser session.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.