个人日志统计
curl --request GET \
--url https://zero.cat/api/log/self/stat \
--header 'Authorization: Bearer <token>'import requests
url = "https://zero.cat/api/log/self/stat"
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/log/self/stat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "",
"data": {
"quota": 120000,
"rpm": 3,
"tpm": 4500
}
}日志与统计
个人日志统计
需要个人访问令牌,作用域:usage:read(用量 → 查看)。
只统计消费类日志。rpm、tpm 是最近 60 秒的统计,不受时间范围参数影响。
GET
/
api
/
log
/
self
/
stat
个人日志统计
curl --request GET \
--url https://zero.cat/api/log/self/stat \
--header 'Authorization: Bearer <token>'import requests
url = "https://zero.cat/api/log/self/stat"
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/log/self/stat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "",
"data": {
"quota": 120000,
"rpm": 3,
"tpm": 4500
}
}授权
个人访问令牌(nap_ 开头),在控制台「安全与访问 → 访问令牌」中创建,不是 sk- 开头的 API 密钥。
查询参数
开始时间(Unix 秒)。不填时从结束时间往前推站点允许的最大范围
结束时间(Unix 秒),不填为当前时间
按 API 密钥名称筛选
按模型名称筛选
按分组筛选

