On this page
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.
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.
Who may call it
Capability area: Billing and the wallet — Your platform bill, token purchases and the usage and cost reads.
- Owner
- Manager
- Associate Manager
- An API key whose scope allows
api:usageReport
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
days | Int | no | No further notes. |
userId | ID | no | No further notes. |
sessionId | ID | no | No further notes. |
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. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (NOT_FOUND)