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

# API-Schlüssel widerrufen

> Dieser Endpunkt widerruft (löscht) einen API-Schlüssel.

## DELETE /api-keys/{keyId}

Dieser Endpunkt widerruft und löscht einen API-Schlüssel dauerhaft. Nach dem Widerruf kann der Schlüssel nicht mehr zur Authentifizierung verwendet werden.

<Warning>
  Diese Aktion ist irreversibel. Ein widerrufener API-Schlüssel kann nicht wiederhergestellt werden.
</Warning>

<Note>
  Sie können nicht den API-Schlüssel widerrufen, mit dem die aktuelle Anfrage authentifiziert wird.
</Note>

### Pfadparameter

<ParamField path="keyId" type="string" required>
  Kennung des zu widerrufenden API-Schlüssels.
</ParamField>

### Antwort

<ResponseField name="success" type="boolean">
  Ob der Schlüssel erfolgreich widerrufen wurde.
</ResponseField>

<ResponseField name="message" type="string">
  Statusmeldung.
</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>
