Hanzo
OpenapiUsage

Is the entitlement-GATED per-provider breakdown of the caller org's LLM usage —…

Is the entitlement-GATED per-provider breakdown of the caller org's LLM usage — the paid lens over the same warehouse ledger GET /v1/usage/summary reads…

GET /v1/usage/analytics

Addresshttps://api.hanzo.ai/v1/usage/analytics
MethodGET
Operationget_usage_analytics
AuthAuthorization: Bearer $HANZO_API_KEY

Is the entitlement-GATED per-provider breakdown of the caller org's LLM usage — the paid lens over the same warehouse ledger GET /v1/usage/summary reads its totals from. Basic own-org usage stays ungated at /v1/usage/summary.

A plan that does not grant the analytics datastore is refused with 402, and an unresolvable plan fails closed to the free floor, which does not grant it. The window is clamped forward to the plan's retention entitlement, so a tenant can never read older than its plan allows even with a custom start. The response is marked no-store.

INTERIM (mirrors apps/world's limits echo): no org→plan resolver exists in cloud yet — the subscription lookup is owned by the billing plane and the gateway principal carries no plan claim — so the caller passes the plan and the gate resolves THAT plan's access.

Request

4 fields.

FieldInTypeRequiredDescription
endquerystringEnd is the exclusive window end, RFC3339.
planquerystringPlan is the plan id whose entitlement decides access and retention.
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.

Response

StatusBodyMeaning
200usageAnalyticsViewok

200 body — 17 fields.

FieldInTypeAlwaysDescription
endbodystringEnd is the window's exclusive end, RFC3339 UTC.
exportbodybooleanExport is whether the resolved plan allows exporting these rows.
planbodystringPlan echoes the plan id the entitlement was resolved from.
providersbodyProviderBreakdown
providers.availablebodybooleanAvailable is false when the warehouse could not be read, which means "no answer" and NOT "no usage" — Items is then empty for a reason.
providers.itemsbodyProviderRow[]Items is one row per provider, most tokens first.
providers.items[].costCentsbodyintegerCostCents is what they cost the org, in US cents.
providers.items[].providerbodystringProvider is the upstream the requests were routed to, e.g.
providers.items[].requestsbodyintegerRequests is how many completions the org made against that provider.
providers.items[].tokensbodyintegerTokens is the total tokens those completions consumed, prompt plus completion.
providers.sourcebodystringSource names the warehouse table the rows came from.
rangebodystringRange is the label that was ASKED for. A plan whose retention is shorter than that window is served the retention instead, so read start and end for the window…
retentionDaysbodyintegerRetentionDays is how far back the resolved plan allows reading.
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.
startbodystringStart is the window's inclusive start, RFC3339 UTC, AFTER the retention clamp — so it may be later than the start that was asked for.

Failure carries the platform error shape — see Errors.

Examples

hanzo usage analytics get

Usage API · All Hanzo APIs · Interactive reference

How is this guide?

On this page