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

# 删除令牌

> 删除指定的 API 令牌

> 更新日期：2026-06-06

## 接口说明

永久删除指定的 API 令牌。删除后该令牌的 API Key 将立即失效。

<Note>
  这组 `/api/token/*` 接口主要用于 Crazyrouter 控制台中的 API Key 管理自动化。它们需要用户 `access token` 与 `New-Api-User` 请求头，不是给普通 `sk-xxx` 模型调用流程直接使用的接口。
</Note>

## 认证方式

使用用户侧认证，请在请求头中携带：

```text theme={null}
Authorization: Bearer your_access_token
New-Api-User: 1
```

## 路径参数

<ParamField path="id" type="integer" required>
  要删除的令牌 ID
</ParamField>

## 响应格式

```json theme={null}
{
  "success": true,
  "message": "令牌删除成功"
}
```

## 代码示例

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "Authorization": "Bearer your_access_token",
      "New-Api-User": "1",
      "User-Agent": "Mozilla/5.0"
  }

  token_id = 10
  response = requests.delete(
      f"https://api.crazyrouter.com/api/token/{token_id}",
      headers=headers
  )

  print(response.json())
  ```

  ```bash cURL theme={null}
  curl -X DELETE https://api.crazyrouter.com/api/token/10 \
    -H "Authorization: Bearer your_access_token" \
    -H "New-Api-User: 1"
  ```
</CodeGroup>

<Warning>
  删除操作不可恢复。删除后使用该 Key 的所有应用将立即无法调用 API。
</Warning>
