查询账户及全部 Key 余额
仅接受 Management Key,返回账户余额总览和所属 Regular Key 的分页余额列表。
请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
page | integer | 否 | 1 | 页码,正整数 |
limit | integer | 否 | 30 | 每页条数,1 到 100 |
key_type | string | 否 | regular | 仅支持空值或 regular;management 返回 400 unsupported_key_type |
status | string | 否 | 无 | 按状态筛选:active 或 disabled |
响应示例
{
"object": "balance",
"currency": "USD",
"as_of": "2026-08-08T06:30:00Z",
"account": {
"total_balance": "850",
"paid_balance": null,
"free_balance": null,
"total_consumed": "150",
"paid_consumed": null,
"free_consumed": null,
"breakdown_status": "unavailable"
},
"keys": [
{
"id": "key_01JPRODUCTION",
"name": "Production Server",
"key_type": "regular",
"disabled": false,
"manually_disabled": false,
"limit": "200",
"limit_reset": "monthly",
"quota_scope": "usage",
"period": {
"start": "2026-07-21T08:30:00Z",
"end_exclusive": "2026-08-21T08:30:00Z"
},
"consumed_this_period": "85.5",
"consumed_today": "2.3",
"key_limit_remaining": "114.5",
"remaining": "114.5",
"effective_remaining": "114.5",
"usage_pct": "42.75",
"status": "active",
"status_reason": null
}
],
"page": 1,
"limit": 30,
"has_more": false,
"total_keys": 1,
"active_keys": 1,
"disabled_keys": 0
}
列表及计数字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
keys | array | 当前页的 Regular Key 余额列表 |
page | integer | 当前页码 |
limit | integer | 当前分页大小 |
has_more | boolean | 是否仍有下一页 |
total_keys | integer | 符合当前筛选条件的 Regular Key 总数,不受分页影响 |
active_keys | integer | 账户下全部 active Regular Key 数量,不受 status 筛选和分页影响 |
disabled_keys | integer | 账户下全部 disabled Regular Key 数量,不受 status 筛选和分页影响 |
列表接口不返回 Key lifetime 消费和按模型明细。需要明细时,调用单 Key 余额接口。
total_keys 受 status 等筛选条件影响,但 active_keys / disabled_keys 反映账户下全部 Regular Key 数量,不受 status 筛选和分页影响。
通用 请求约定、字段定义与错误码见 余额查询接口概览。