1. 查询账户余额
鉴权方式
Authorization: Bearer <API Key>
⚠️ 仅允许使用该账号的默认 API Key,其他 Key 将返回 403 Forbidden。
请求示例
成功响应 (200)
| 字段 | 类型 | 说明 |
|---|---|---|
object | string | 固定值 "balance" |
balance | number | 账户余额(元),保留 4 位小数 |
currency | string | 货币单位,"RMB" |
note | string | 备注说明 |
错误响应
| 状态码 | 说明 |
|---|---|
| 401 | API Key 缺失或无效 |
| 403 | API Key 有效但不是默认 Key |
2. 查询 API Key 费用信息
鉴权方式
Authorization: Bearer <API Key>
⚠️ 仅允许使用该账号的默认 API Key,其他 Key 将返回 403 Forbidden。
请求示例
成功响应 (200)
| 字段 | 类型 | 说明 |
|---|---|---|
object | string | 固定值 "list" |
data | array | API Key 费用信息列表 |
data 数组中的字段
| 字段 | 类型 | 说明 |
|---|---|---|
apikey | string | API Key,仅显示前 10 位,其余用 * 掩盖 |
name | string | API Key 名称 |
cost | number | 累计费用(元) |
budget | number | 预算限额(0 表示无限制) |
created_at | number | 创建时间(Unix 时间戳) |
expiry_date | string / null | 有效期截止日期(YYYY-MM-DD),null 表示永不过期 |
daily_limit | number | 每日消费限额(元),0 表示无限制 |
monthly_limit | number | 每月消费限额(元),0 表示无限制 |
cost_today | number | 今日已消费金额。 |
cost_this_month | number | 本月已消费金额。 |
input_price_limit | number | 模型输入价格限额(元/M token),0 表示无限制 |
output_price_limit | number | 模型输出价格限额(元/M token),0 表示无限制 |
group_id | string / null | 该 API Key 所属分组的 ID,null 表示未分组 |
group_name | string / null | 该 API Key 所属分组的名称,null 表示未分组,空字符串表示分组已被删除 |
错误响应
| 状态码 | 说明 |
|---|---|
| 401 | API Key 缺失或无效 |
| 403 | API Key 有效但不是默认 Key |