查询限定时间区间的工作区用量
所需权限:usage:read。使用绑定目标工作区的 OpenAPI Key,以 Authorization: Bearer <OpenAPI Key> 鉴权。
Query Parameters
- Type: string enumrangerequired
custom须同时提供from/to,最大30天。
values- 1h
- 1d
- 7d
- 30d
- month
- custom
- Type: stringfrom
RFC3339时间或YYYY-MM-DD日期(UTC)。
- Type: stringto
RFC3339为不包含的结束时刻;YYYY-MM-DD包含该日,按UTC解析。
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
Request Example for get/v1/usage
curl 'https://openapi.apigo.ai/v1/usage?range=7d&from=2026-01-01T00%3A00%3A00Z&to=2026-01-08T00%3A00%3A00Z' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"code": 0,
"message": "string",
"data": {
"requests": 1,
"input_tokens": 1,
"output_tokens": 1,
"cost_usd": 1,
"cost_usd_exact": "string",
"fallback_request_count": 1,
"range": {
"from": "2026-10-19T02:14:25.531Z",
"to": "2026-10-19T02:14:25.531Z"
}
}
}