Hanzo
OpenapiLink

Breaks down what the gateway routed through each of your accounts.

Breaks down what the gateway routed through each of your accounts.

GET /v1/link/usage/accounts

Addresshttps://api.hanzo.ai/v1/link/usage/accounts
MethodGET
Operationget_link_usage_accounts
AuthAuthorization: Bearer $HANZO_API_KEY

Breaks down what the gateway routed through each of your accounts.

It answers one row per linked account the GATEWAY actually routed through, plus their total — requests, prompt and completion tokens, and cost. This is the routed ledger, the read twin of the counter the router writes, and it is distinct from both of its neighbours: not the device collector's plan snapshots, and not the org money ledger. The source and scope fields on the response say so on every payload. The same shape answers in the billing namespace, from one shaping function, so the two mounts cannot drift.

Request

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

Response

StatusBodyMeaning
200AccountsUsageok

200 body — 19 fields.

FieldInTypeAlwaysDescription
accountsbodyRoutedUsage[]Accounts is one row per linked account the gateway actually routed through.
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.
scopebodystringScope is always "user": the caller's own linked accounts.
sourcebodystringSource is always "routed": the gateway's own routed ledger.
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 links usage accounts

Link API · All Hanzo APIs · Interactive reference

How is this guide?

On this page