1. 文档
  2. API 参考
  3. 余额与用量

余额与用量

GEThttps://api.airoutly.com/v1/dashboard/billing/subscription

在代码里查询某个 Key 的额度和消费,格式兼容旧版 OpenAI 客户端和看板。账户余额和逐条明细请在控制台查看。

余额

curl
curl https://api.airoutly.com/v1/dashboard/billing/subscription \
  -H "Authorization: Bearer $AIROUTLY_API_KEY"
200 OK
{
  "object": "billing_subscription",
  "has_payment_method": true,
  "soft_limit_usd": 20,
  "hard_limit_usd": 20,
  "system_hard_limit_usd": 20,
  "access_until": 0
}

hard_limit_usd 是这个 Key 的总额度(已用加剩余,单位美元),不是账户余额。没有设置额度上限的 Key 返回 100000000。access_until 是 Key 的过期时间(Unix 时间戳),永不过期时为 0。

用量

curl
curl "https://api.airoutly.com/v1/dashboard/billing/usage" \
  -H "Authorization: Bearer $AIROUTLY_API_KEY"
200 OK
{ "object": "list", "total_usage": 231.5 }

total_usage 是这个 Key 至今的消费,单位为美分(231.5 即 $2.315)。

日期参数为了兼容会接受 start_date 和 end_date 参数,但不会按日期过滤结果。按天查看消费请用控制台的用量日志。

去掉 /v1 的 /dashboard/billing/subscription 和 /dashboard/billing/usage 同样可用。