查询 API 密钥用量
curl --request GET \
--url https://zero.cat/api/usage/token/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://zero.cat/api/usage/token/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://zero.cat/api/usage/token/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": true,
"message": "ok",
"data": {
"object": "token_usage",
"name": "my-key",
"total_granted": 500000,
"total_used": 100000,
"total_available": 400000,
"unlimited_quota": false,
"model_limits": {},
"model_limits_enabled": false,
"expires_at": 0,
"user_quota": {
"total_available": 400000,
"total_used": 100000
}
}
}API 密钥管理
查询 API 密钥用量
用要查询的 API 密钥本身鉴权,不需要个人访问令牌。
GET
/
api
/
usage
/
token
/
查询 API 密钥用量
curl --request GET \
--url https://zero.cat/api/usage/token/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://zero.cat/api/usage/token/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://zero.cat/api/usage/token/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": true,
"message": "ok",
"data": {
"object": "token_usage",
"name": "my-key",
"total_granted": 500000,
"total_used": 100000,
"total_available": 400000,
"unlimited_quota": false,
"model_limits": {},
"model_limits_enabled": false,
"expires_at": 0,
"user_quota": {
"total_available": 400000,
"total_used": 100000
}
}
}
