# 查询令牌余额（已废弃）

> <mark style="color:$warning;">当前端口已停止维护，请查看新版接口：</mark>[查询余额](/tool/balance.md)

#### 接口信息

* **接口路径**：`/api/token`
* **请求方法**：POST
* **部署地址**：`https://billing.openkey.cloud/api/token`

[注意：v1通道用户，接口路径为 /api/v1/token](#user-content-fn-1)[^1]

#### 请求参数

* **api\_key** (string): 用户的API令牌。

#### 请求示例

使用curl进行请求：

```bash
curl -X POST -H "Content-Type: application/json" -d '{"api_key":"your_api_key_here"}' https://billing.openkey.cloud/api/token
```

#### 响应格式

接口将返回JSON格式的响应。

**成功响应**

* **Status** (int): 状态码，1表示成功。
* **Total** (float): 令牌的总额度。
* **Used** (float): 已使用的金额。
* **Remaining** (float): 剩余的金额。

示例：

```json
code{
    "Remaining": 2.0,
    "Status": 1,
    "Total": 2.52949,
    "Used": 0.529906
}
```

**错误响应**

* **Status** (int): 状态码，0表示错误。
* **Error** (string): 错误信息。

示例：

```json
code{
    "Error": "查询失败，API Key已失效或不存在",
    "Status": 0
}
```

#### 错误处理

* 如果未输入API Key，将返回400状态码和错误信息。
* 如果API Key无效或不存在，将返回错误信息。

Web查询面板：<https://billing.openkey.cloud/>

[^1]:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openkey.cloud/api/token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
