AlmondTill/G3N API

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:

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

NameTypeRequiredNotes
daysIntno
userIdIDno
sessionIdIDno

Returns

UsageReportWindow UsageReportWindow! — Your group's consumption window at ONE lane: the days with usage, newest first, + the window totals.

Example request

graphql
query ExampleUsageReport($days: Int) {
  usageReport(days: $days) {
    totalCalls
    totalKernels
  }
}

Variables:

json
{
  "days": 1
}

Example response

json
{
  "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

Used in