> ## 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 키 폐기

> API 키를 폐기(삭제)하는 엔드포인트입니다.

## DELETE /api-keys/{keyId}

API 키를 영구 폐기·삭제합니다. 폐기 후 해당 키로는 더 이상 요청 인증을 할 수 없습니다.

<Warning>
  되돌릴 수 없는 작업입니다. 폐기된 API 키는 복구할 수 없습니다.
</Warning>

<Note>
  현재 요청에 사용 중인 API 키는 폐기할 수 없습니다.
</Note>

### 경로 매개변수

<ParamField path="keyId" type="string" required>
  폐기할 API 키 ID입니다.
</ParamField>

### 응답

<ResponseField name="success" type="boolean">
  폐기 성공 여부입니다.
</ResponseField>

<ResponseField name="message" type="string">
  상태 메시지입니다.
</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>
