curl -G "https://qcg-api.scanova.io/console/usage/" \
-H "Authorization: Bearer <your_oauth_access_token>" \
-d environment=live \
-d period=month
{
"total_requests": 4820,
"successful_requests": 4761,
"failed_requests": 59
}
管理 API — 令牌与使用情况
用量统计
GET /console/usage/
GET
/
console
/
usage
/
curl -G "https://qcg-api.scanova.io/console/usage/" \
-H "Authorization: Bearer <your_oauth_access_token>" \
-d environment=live \
-d period=month
{
"total_requests": 4820,
"successful_requests": 4761,
"failed_requests": 59
}
返回给定密钥 environment 在一个滚动时间窗口内的请求次数总计。与其他
无效的
console/ 端点一样,此端点位于常规的 Scanova API 主机(qcg-api.scanova.io)上,使用您的仪表盘 OAuth 访问令牌进行身份验证。
数据是跨账户下所有共享同一
environment 的密钥进行聚合的,而不是单一密钥的数据。如果您想要某一个密钥的终身总用量,那是 GET /console/token/ 返回的 usage_count 字段。请求
GET https://qcg-api.scanova.io/console/usage/
Authorization: Bearer <your_oauth_access_token>
string
必填
sandbox、live、zapier、mcp 之一。选择要聚合哪些密钥的日志。string
默认值:"week"
day、week、month、year 之一。截至当前的滚动时间窗口,请求会在此窗口内被统计。curl -G "https://qcg-api.scanova.io/console/usage/" \
-H "Authorization: Bearer <your_oauth_access_token>" \
-d environment=live \
-d period=month
{
"total_requests": 4820,
"successful_requests": 4761,
"failed_requests": 59
}
响应字段
integer
此 environment 下的密钥在该时间窗口内记录的请求总数。
integer
返回状态码低于
400 的请求数。integer
返回状态码为
400 或以上的请求数。错误
environment 为必填项——省略它,或传入上述四个值之外的其他值,都会返回:
400 Bad Request
{ "environment": ["A valid environment is required."] }
period 会返回:
400 Bad Request
{ "period": ["period must be one of day, week, month, year."] }
相关内容
- 每日用量 —— 同样的数字,按日历日拆分。
- 按端点统计用量 —— 同样的数字,按路由和方法拆分。
- 创建一个 API 令牌 —— 单个密钥的终身
usage_count字段(与此处的 environment 级总量不同)的来源。
授权
Send your Management API key as the raw value of the Authorization header — no "Bearer " or "Token " prefix, and no other characters. Example: Authorization: 401f7ac837da42b97f613d789819ff93537bee6a. A header containing more than one space-separated part is rejected outright. Requests also require the request's Host header to be the management API host (e.g. management.scanova.io) — the same key sent to the regular API host will not authenticate.
响应
200
Usage stats
此页面对您有帮助吗?
⌘I