查询:令牌限额
简洁描述:查询当前 API key 的授权额度(令牌限额)。
概览
- 请求方法:
GET - 路径:
/v1/dashboard/billing/subscription - 内容类型:
application/json
认证方式
- Header:
Authorization: Bearer <token>
请求示例
curl 示例
bash
curl -X GET "https://api.gpt.ge/v1/dashboard/billing/subscription" \
-H "Authorization: Bearer sk-xxxx"JavaScript (fetch) 示例
javascript
fetch('https://api.gpt.ge/v1/dashboard/billing/subscription', {
method: 'GET',
headers: {
'Authorization': 'Bearer sk-xxxx'
}
}).then(r => r.json()).then(console.log);Python(requests)示例
python
import requests
url = 'https://api.gpt.ge/v1/dashboard/billing/subscription'
headers = {
'Authorization': 'Bearer sk-xxxx'
}
response = requests.get(url, headers=headers)
print(response.json())返回示例(200)
json
{
"object": "billing_subscription",
"has_payment_method": true,
"soft_limit_usd": 5,
"hard_limit_usd": 5,
"system_hard_limit_usd": 5,
"access_until": 0
}注意:若令牌设置为无限额度,返回值可能为
100000000。额度变更将会在原有授权限额基础上累加。