Hanzo
OpenapiUsage

Answers GET /v1/usage/summary: the caller's own usage footprint over one window…

Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM…

GET /v1/usage/summary

Addresshttps://api.hanzo.ai/v1/usage/summary
MethodGET
Operationget_usage_summary
AuthAuthorization: Bearer $HANZO_API_KEY

Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage.

Every source degrades INDEPENDENTLY to honest zeros and says so in sources and in its own available flag, so a partial deploy reports "no data" rather than fabricating spend. The account rows and the Hanzo rows are concatenated and never summed: a plan's percent is not money.

The response is org-scoped from the validated principal and marked no-store — a signed-out caller is refused.

Request

3 fields.

FieldInTypeRequiredDescription
rangequerystringRange is the window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all, custom. Empty means 24h.
startquerystringStart is the inclusive window start, RFC3339.
endquerystringEnd is the exclusive window end, RFC3339.

Response

StatusBodyMeaning
200usageSummaryok

200 body — 56 fields.

FieldInTypeAlwaysDescription
accountsbodyAccounts
accounts.accountbodySourceState
accounts.account.availablebodybooleanAvailable is whether this side's ledger answered.
accounts.account.notebodystringNote is the human sentence that says what this side's numbers mean, so a board cannot present a plan percentage as a Hanzo charge.
accounts.account.scopebodystringScope is whose rows this side carries: "user" or "org".
accounts.account.sourcebodystringSource is the table of record the rows came from.
accounts.hanzobodySourceState
accounts.hanzo.availablebodybooleanAvailable is whether this side's ledger answered.
accounts.hanzo.notebodystringNote is the human sentence that says what this side's numbers mean, so a board cannot present a plan percentage as a Hanzo charge.
accounts.hanzo.scopebodystringScope is whose rows this side carries: "user" or "org".
accounts.hanzo.sourcebodystringSource is the table of record the rows came from.
accounts.rowsbodyTotalView[]Rows is the two row sets CONCATENATED, never summed — each row says which side it came from.
accounts.rows[].confidencebodystringConfidence says how much the counters mean; a percentage-only meter leaves them at zero.
accounts.rows[].costCentsbodyintegerCostCents is the row's cost in US cents.
accounts.rows[].providerbodystringProvider is the upstream the usage was measured against.
accounts.rows[].requestsbodyintegerRequests is how many requests the row covers.
accounts.rows[].scopebodystringScope is whose row it is: "user" for the caller's own linked accounts, "org" for the whole tenant's Hanzo-routed usage.
accounts.rows[].sourcebodystringSource is where the row came from: "account" is the provider's own meter on the caller's linked account, "hanzo" is Hanzo-routed inference.
accounts.rows[].tokensbodyintegerTokens is the total tokens the row covers.
accounts.rows[].usedPctbodynumberUsedPct is how much of a plan window the row consumed, 0–100.
accounts.rows[].windowbodystringWindow is the meter window class the row rolls up, when it has one.
accounts.rows[].windowsbodyintegerWindows is how many window instances rolled up into the row.
endbodystringEnd is the window's exclusive end, RFC3339 UTC.
intervalbodystringInterval is the bucket width the spend series is gap-filled at.
llmbodyLLM
llm.availablebodybooleanAvailable is false when the warehouse was not connected or a query blipped.
llm.completionTokensbodyintegerCompletionTokens is the output half.
llm.costCentsbodyintegerCostCents is what they cost the org, in US cents.
llm.modelsbodyintegerModels is how many distinct models were used.
llm.promptTokensbodyintegerPromptTokens is the input half of that total.
llm.requestsbodyintegerRequests is how many completions the org made in the window.
llm.sourcebodystringSource names the warehouse table the totals came from.
llm.tokensbodyintegerTokens is the total tokens those completions consumed.
rangebodystringRange is the window label that was served.
scopebodyusageScope
scope.orgbodystringOrg is the IAM org slug the rows were read under — the validated principal's, never a client header.
scope.userbodystringUser is the caller's own subject, whose linked-account rows the accounts block carries.
sourcesbodySources
sources.commercebodybooleanCommerce is whether the billing ledger answered the spend block.
sources.warehousebodybooleanWarehouse is whether the usage warehouse answered the LLM block.
spendbodySpend
spend.availablebodybooleanAvailable is false when the commerce ledger was unconfigured or unreachable.
spend.availableCentsbodyintegerAvailableCents is what of that balance is still spendable.
spend.balanceCentsbodyintegerBalanceCents is the prepaid wallet's balance, in US cents.
spend.byCategorybodyCategorySpend[]ByCategory is the window's spend split by ledger category, largest first.
spend.byCategory[].categorybodystringCategory is the bucket the ledger's own tag mapped to.
spend.byCategory[].centsbodyintegerCents is what the org spent in that bucket over the window, in US cents.
spend.byCategory[].countbodyintegerCount is how many ledger lines rolled up into it.
spend.mtdCentsbodyintegerMTDCents is commerce's authoritative month-to-date consumed figure, which is a different period from the window and is not derived from it.
spend.overageCentsbodyintegerOverageCents is month-to-date consumption beyond the plan's allowance.
spend.seriesbodySpendPoint[]Series is the window's spend over time, gap-filled at the window's interval.
spend.series[].centsbodyintegerCents is the consumption recorded in that bucket, in US cents.
spend.series[].tbodystringT is the bucket's start instant, RFC3339 UTC.
spend.sourcebodystringSource names where the roll-up came from.
spend.totalCentsbodyintegerTotalCents is consumption over the requested window, in US cents.
startbodystringStart is the window's inclusive start, RFC3339 UTC.

Failure carries the platform error shape — see Errors.

Examples

hanzo usage summary

Usage API · All Hanzo APIs · Interactive reference

How is this guide?

On this page