Get workspace usage for a bounded time range
Required permission: usage:read. Authenticate with an OpenAPI Key bound to the target workspace using Authorization: Bearer <OpenAPI Key>.
Query Parameters
- Type: string enumrangerequired
custom requires both from and to, with a maximum range of 30 days.
values- 1h
- 1d
- 7d
- 30d
- month
- custom
- Type: stringfrom
An RFC3339 timestamp or YYYY-MM-DD date (UTC).
- Type: stringto
RFC3339 is an exclusive end time. YYYY-MM-DD includes that day and is interpreted in 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.529Z",
"to": "2026-10-19T02:14:25.529Z"
}
}
}