Hanzo
OpenapiLink

Shows plan consumption and Hanzo spend side by side.

Shows plan consumption and Hanzo spend side by side.

GET /v1/link/usage/summary

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

Shows plan consumption and Hanzo spend side by side.

It answers the global usage board over one window: the caller's own linked accounts, metered from each provider's own login, alongside their org's Hanzo-routed inference. These come from different ledgers and mean different things, so every row is LABELLED by source, by scope and by availability, and THE TWO ARE NEVER SUMMED — a plan's percentage is not money, and a provider's own spend is not a Hanzo charge. The rows sit side by side and say what they are.

One resolver fixes the window for both halves, so the two sets always cover the same period. range is one of 1h, 24h, 7d or 30d and defaults to 24h; anything else is 400 rather than a silent substitution. A ledger that cannot answer reports available:false instead of a zero that would read as "no usage".

Request

1 field.

FieldInTypeRequiredDescription
rangequerystringRange is the period, one of 1h, 24h, 7d or 30d; empty means 24h, and an unknown label is 400, never a silent substitution.

Response

StatusBodyMeaning
200summaryRespok

200 body — 24 fields.

FieldInTypeAlwaysDescription
accountbodysourceState
account.availablebodybooleanAvailable reports whether this ledger answered; false is honest "unavailable", never a zero that would read as no usage.
account.notebodystringNote says in prose what the ledger's numbers mean.
account.scopebodystringScope is whose usage the ledger measures: user or org.
account.sourcebodystringSource is the table of record behind the ledger.
frombodystringFrom is when the window opens, RFC 3339 UTC.
hanzobodysourceState
hanzo.availablebodybooleanAvailable reports whether this ledger answered; false is honest "unavailable", never a zero that would read as no usage.
hanzo.notebodystringNote says in prose what the ledger's numbers mean.
hanzo.scopebodystringScope is whose usage the ledger measures: user or org.
hanzo.sourcebodystringSource is the table of record behind the ledger.
rangebodystringRange is the resolved period label.
rowsbodytotalView[]Rows is the union of both ledgers, each row labelled by source and scope — concatenated, NEVER summed: a plan's percentage is not money.
rows[].confidencebodystringConfidence says how real the row's numbers are.
rows[].costCentsbodyintegerCostCents is the period's spend in cents, in the row's own ledger.
rows[].providerbodystringProvider is the provider the row totals.
rows[].requestsbodyintegerRequests is the period's request count.
rows[].scopebodystringScope is whose usage the row measures: user or org.
rows[].sourcebodystringSource is whose meter the row came from: account or hanzo.
rows[].tokensbodyintegerTokens is the period's total token count.
rows[].usedPctbodynumberUsedPct is the plan consumption percentage, on the account side.
rows[].windowbodystringWindow is the window class the row totals, on the account side.
rows[].windowsbodyintegerWindows is how many window instances the row folds.
tobodystringTo is where the window closes, EXCLUSIVE, RFC 3339 UTC — the instant the read was served.

Failure carries the platform error shape — see Errors.

Examples

hanzo links usage summary

Link API · All Hanzo APIs · Interactive reference

How is this guide?

On this page