usageReport
query · in the family Billing and the wallet
What it does
What your group’s use of the platform consumes, day by day, in kernels — with a per-kind breakdown, and a drill to one person or one sitting.
Your group's metered consumption by UTC day, in kernels: composed off the daily rollup rows the billing rater grows with every rated batch, ≤ 92 bounded point-reads — never a scan. ONE lane per call: no drill arg = the whole group (total); userId = that user's lane; sessionId = that session's lane (userId AND sessionId together refuse VALIDATION — one grain at a time). Self-group BY construction (the tokenEntries stance); days defaults 30, clamps 1..92; only days with usage answer. Events predating the attribution stamps roll into the group lane only — a user/session window over old history answers honestly empty. Requires authentication.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Billing and the wallet — Your platform bill, token purchases and the usage and cost reads.
Roles that may call it:
- Owner
- Manager
- Associate Manager
- An API key whose scope allows
api:usageReport
What happens
A read over the running consumption counters behind your kernel balance; one lane per call — the whole group, one user, or one session. Only days with usage appear; history from before the fine-grained stamps shows under the group lane only.
Arguments
Returns
UsageReportWindow UsageReportWindow! — Your group's consumption window at ONE lane: the days with usage, newest first, + the window totals.
Example request
query ExampleUsageReport($days: Int) {
usageReport(days: $days) {
totalCalls
totalKernels
}
}Variables:
{
"days": 1
}Example response
{
"data": {
"usageReport": {
"totalCalls": 1,
"totalKernels": 1.5
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)