Hanzo
OpenapiBilling

Answers per-account totals for the linked provider accounts the gateway ROUTED…

Answers per-account totals for the linked provider accounts the gateway ROUTED this caller's traffic through — requests, prompt and completion tokens,…

GET /v1/billing/usage/accounts

Addresshttps://api.hanzo.ai/v1/billing/usage/accounts
MethodGET
Operationget_billing_usage_accounts
AuthAuthorization: Bearer $HANZO_API_KEY

Answers per-account totals for the linked provider accounts the gateway ROUTED this caller's traffic through — requests, prompt and completion tokens, recorded cost — plus their honest sum.

This is the one read in the billing namespace scoped to the PERSON, not the org. Rows are keyed on (validated org, validated user), so a caller sees the accounts THEY linked and never a colleague's, even inside one org — everything else under /v1/billing is org-wide. Neither key is ever read from the request body or the query.

It is a ROUTING counter, not the money ledger. costCents is 0 for an account billed by its own subscription, where the plan pays the provider directly, so these totals do not reconcile against what the org was charged. /v1/billing/usage is the charged ledger.

401 without a validated principal. Where the linked-account plane is not resident the answer is an honest 501 — never an empty breakdown, which would read as no usage.

Request

GET /v1/billing/usage/accounts takes no parameters and no body — the credential is the whole request.

Response

StatusBodyMeaning
200accountsok

200 body — 19 fields.

FieldInTypeAlwaysDescription
accountsbodyRoutedUsage[]
accounts[].accountbodystringAccount is the provider-side account identifier.
accounts[].billingbodystringBilling is how the routed inference bills: plan or commerce.
accounts[].completionTokensbodyintegerCompletionTokens is the routed completion-token count.
accounts[].costCentsbodyintegerCostCents is the routed cost in cents.
accounts[].kindbodystringKind is how the account authenticates: subscription or apikey.
accounts[].promptTokensbodyintegerPromptTokens is the routed prompt-token count.
accounts[].providerbodystringProvider is the AI provider the row's account belongs to.
accounts[].requestsbodyintegerRequests is how many requests the gateway routed through this account.
accounts[].totalTokensbodyintegerTotalTokens is the routed total token count.
scopebodystring
sourcebodystring
totalbodyAccountsTotal
total.accountsbodyintegerAccounts is how many linked accounts the total folds.
total.completionTokensbodyintegerCompletionTokens is the total completion-token count.
total.costCentsbodyintegerCostCents is the total cost in cents.
total.promptTokensbodyintegerPromptTokens is the total prompt-token count.
total.requestsbodyintegerRequests is the total request count the gateway routed.
total.totalTokensbodyintegerTotalTokens is the total token count.

Failure carries the platform error shape — see Errors.

Examples

hanzo billing usage accounts

Billing API · All Hanzo APIs · Interactive reference

How is this guide?

On this page