端点 GET /v1/billing/balance
查询当前 API Key 所属账户的可用余额。账户身份从 API Key 识别,无需其他参数。
请求
鉴权使用 Authorization: Bearer sk-xxxxxx,无查询参数。
参数
无。
响应
json
{
"balance": { "value": "85.320000", "currency": "USD" }
}| 字段 | 说明 |
|---|---|
balance.value | 可用余额,字符串金额 |
balance.currency | 币种 |
示例
bash
curl "https://caapi.top/v1/billing/balance" \
-H "Authorization: Bearer sk-xxxxxx"错误
| HTTP 状态 | error.type | 触发条件 |
|---|---|---|
| 401 | missing_auth_credential / invalid_bearer_token | 鉴权失败,详见 鉴权 |