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

# Revogar chave de API

> Este endpoint revoga (exclui) uma chave de API.

## DELETE /api-keys/{keyId}

Este endpoint revoga e exclui permanentemente uma chave de API. Após a revogação, ela não pode mais autenticar requisições.

<Warning>
  Ação irreversível. Uma chave revogada não pode ser recuperada.
</Warning>

<Note>
  Não é possível revogar a chave de API usada na própria requisição.
</Note>

### Parâmetros de caminho

<ParamField path="keyId" type="string" required>
  ID da chave a revogar.
</ParamField>

### Resposta

<ResponseField name="success" type="boolean">
  Se a chave foi revogada com sucesso.
</ResponseField>

<ResponseField name="message" type="string">
  Mensagem de status.
</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 Sucesso (200) theme={null}
  {
    "success": true,
    "message": "API key revoked successfully"
  }
  ```

  ```json Não é possível revogar a chave atual (400) theme={null}
  {
    "message": "Cannot revoke the API key currently being used"
  }
  ```

  ```json Não encontrado (404) theme={null}
  {
    "message": "API key not found"
  }
  ```

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