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

# Revocar clave API

> Este extremo revoca (elimina) una clave API.

## DELETE /api-keys/{keyId}

Este extremo revoca y elimina de forma permanente una clave API. Una vez revocada, la clave ya no puede utilizarse para autenticar solicitudes.

<Warning>
  Esta acción es irreversible. Una vez revocada una clave API, no puede recuperarse.
</Warning>

<Note>
  No puede revocar la clave API que está utilizando actualmente para realizar la solicitud.
</Note>

### Parámetros de ruta

<ParamField path="keyId" type="string" required>
  Identificador de la clave API a revocar.
</ParamField>

### Respuesta

<ResponseField name="success" type="boolean">
  Indica si la clave se revocó correctamente.
</ResponseField>

<ResponseField name="message" type="string">
  Mensaje de estado.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456',
    {
      method: 'DELETE',
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  );
  ```
</RequestExample>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "message": "API key revoked successfully"
  }
  ```

  ```json Cannot Revoke Current Key (400) theme={null}
  {
    "message": "Cannot revoke the API key currently being used"
  }
  ```

  ```json Not Found (404) theme={null}
  {
    "message": "API key not found"
  }
  ```

  ```json Forbidden (403) theme={null}
  {
    "message": "Access denied to this API key"
  }
  ```
</ResponseExample>
