外观
查询令牌额度
GET
https://vip.zen-ai.top/v1/dashboard/billing/subscriptionOpenAI 兼容的账单查询接口,只需令牌本身即可调用,很多客户端的「余额查询」功能使用这组接口。金额单位为美元额度(刀)。
总额度
GET /v1/dashboard/billing/subscription
objectstring固定为 billing_subscription。
hard_limit_usdnumber总额度(美元),等于已用额度 + 剩余额度。无限额度令牌显示账户额度。
soft_limit_usdnumber同 hard_limit_usd。
system_hard_limit_usdnumber同 hard_limit_usd。
has_payment_methodboolean固定为 true。
access_untilinteger令牌过期时间戳,0 表示永不过期。
已用额度
GET /v1/dashboard/billing/usage
objectstring固定为 list。
total_usagenumber已用额度,单位为美分(除以 100 得到美元)。
剩余额度 = hard_limit_usd − total_usage ÷ 100
网页查询
也可以直接打开 usage.144096.xyz,输入令牌查看额度与使用记录。
请求示例
bash
curl https://vip.zen-ai.top/v1/dashboard/billing/subscription \
-H "Authorization: Bearer $VIP_API_KEY"
curl https://vip.zen-ai.top/v1/dashboard/billing/usage \
-H "Authorization: Bearer $VIP_API_KEY"python
import requests
BASE = "https://vip.zen-ai.top"
headers = {"Authorization": "Bearer sk-xxxxxxxx"}
sub = requests.get(f"{BASE}/v1/dashboard/billing/subscription", headers=headers).json()
usage = requests.get(f"{BASE}/v1/dashboard/billing/usage", headers=headers).json()
total = sub["hard_limit_usd"]
used = usage["total_usage"] / 100
print(f"总额度 ${total:.2f},已用 ${used:.2f},剩余 ${total - used:.2f}")响应示例
json
{
"object": "billing_subscription",
"has_payment_method": true,
"soft_limit_usd": 100,
"hard_limit_usd": 100,
"system_hard_limit_usd": 100,
"access_until": 0
}json
{
"object": "list",
"total_usage": 2356.8
}