usage_list
GET
/usage
const url = 'https://api.canopyhq.dev/usage?from=example&to=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.canopyhq.dev/usage?from=example&to=example' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”from
required
string
First UTC checkpoint day, YYYY-MM-DD, inclusive.
to
required
string
Last UTC checkpoint day, YYYY-MM-DD, inclusive.
Responses
Section titled “Responses”Daily usage rows for the owner’s tenant. Missing days have no checkpointed usage.
Media typeapplication/json
Array<object>
One tenant’s aggregate for a UTC checkpoint day.
object
bytes_archived
required
integer format: int64
day
required
string
events
required
integer format: int64
sessions_checkpointed
required
integer format: int64
tokens
required
object
key
additional properties
Tokens attributed to one model on a daily row.
object
input
required
integer format: int64
output
required
integer format: int64
tool_calls
required
object
key
additional properties
integer format: int64
Examplegenerated
[ { "bytes_archived": 1, "day": "example", "events": 1, "sessions_checkpointed": 1, "tokens": { "additionalProperty": { "input": 1, "output": 1 } }, "tool_calls": { "additionalProperty": 1 } }]Missing or invalid dates, or from is after to.
A valid console token is required.
Only a tenant owner may read usage.