跳到主要内容

查询账户及全部 Key 余额

仅接受 Management Key,返回账户余额总览和所属 Regular Key 的分页余额列表。

请求参数

参数类型必填默认值说明
pageinteger否1页码,正整数
limitinteger否30每页条数,1 到 100
key_typestring否regular仅支持空值或 regular;management 返回 400 unsupported_key_type
statusstring否无按状态筛选: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
}

列表及计数字段说明

字段类型说明
keysarray当前页的 Regular Key 余额列表
pageinteger当前页码
limitinteger当前分页大小
has_moreboolean是否仍有下一页
total_keysinteger符合当前筛选条件的 Regular Key 总数,不受分页影响
active_keysinteger账户下全部 active Regular Key 数量,不受 status 筛选和分页影响
disabled_keysinteger账户下全部 disabled Regular Key 数量,不受 status 筛选和分页影响

列表接口不返回 Key lifetime 消费和按模型明细。需要明细时,调用单 Key 余额接口。

计数语义

total_keys 受 status 等筛选条件影响,但 active_keys / disabled_keys 反映账户下全部 Regular Key 数量,不受 status 筛选和分页影响。

相关接口

通用请求约定、字段定义与错误码见 余额查询接口概览。

在线客服