Hanzo
OpenapiLink

Shows one provider account's own usage dashboard.

Shows one provider account's own usage dashboard.

GET /v1/link/usage

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

Shows one provider account's own usage dashboard.

It answers the time series for a SINGLE provider account — the windows in range plus the currently-open ones — as that provider's own meter reported it: "my plan is 47% through its 6h window, resets at 14:20". current is the newest instance of each lane (the headline); windows is the history behind it, both computed from ONE deduped read. provider is required; an unknown window class or range is 400, never a quiet fallback to a different one. When no series is available the response is a 200 with available:false and empty lists — an honest "we have no data", which is a different claim from zero usage.

Request

4 fields.

FieldInTypeRequiredDescription
providerquerystringProvider is the provider whose meter to read.
accountquerystringAccount narrows to one account when a user has several with the provider.
windowquerystringWindow selects a window class: 6h, day, week or month.
rangequerystringRange is the period, one of 1h, 24h, 7d or 30d; empty means 24h, and an unknown label is 400, never a quiet fallback.

Response

StatusBodyMeaning
200boardRespok

200 body — 48 fields.

FieldInTypeAlwaysDescription
accountbodystringAccount is the account the series narrows to, when one was named.
availablebodybooleanAvailable reports whether the warehouse answered; false is an honest "we have no data", NOT zero usage.
currentbodyreadingView[]Current is the live state of each lane — the dash headline.
current[].accountbodystringAccount is the provider-side account the sample belongs to.
current[].cachedInputTokensbodyintegerCachedInputTokens is the window's cached-prompt-token count.
current[].confidencebodystringConfidence says whether the counters that remain mean anything, as the meter graded itself.
current[].costCentsbodyintegerCostCents is the window's spend in cents, as the provider's meter states it.
current[].costLimitCentsbodyintegerCostLimitCents is the window's spend cap in cents, when the meter knows one.
current[].currencybodystringCurrency is the ISO currency the cost fields are stated in.
current[].inputTokensbodyintegerInputTokens is the window's prompt-token count.
current[].lanebodystringLane names the meter's own lane label for this measurement.
current[].machinebodystringMachine is the machine the collector observed the account on.
current[].outputTokensbodyintegerOutputTokens is the window's completion-token count.
current[].planbodystringPlan is the provider plan label the account is on.
current[].requestsbodyintegerRequests is the window's request count.
current[].resetsAtbodystringResetsAt is when the window resets, RFC 3339 UTC.
current[].syntheticbodybooleanSynthetic marks a sample the collector derived rather than observed.
current[].totalTokensbodyintegerTotalTokens is the window's total token count.
current[].usedPctbodynumberUsedPct is how much of the window's allowance is consumed, 0..100.
current[].windowbodystringWindow is the window class: 6h, day, week or month.
current[].windowMinutesbodyintegerWindowMinutes is the window's length as the meter reported it.
current[].windowStartbodystringWindowStart is when the measured window opened, RFC 3339 UTC.
frombodystringFrom is when the resolved window opens, RFC 3339 UTC.
providerbodystringProvider is the provider whose meter answered.
rangebodystringRange is the resolved period label.
scopebodystringScope is always "user": the caller's own linked accounts.
sourcebodystringSource is always "account": the provider's own meter, not a Hanzo charge.
tobodystringTo is where it closes, EXCLUSIVE, RFC 3339 UTC — the instant the read was served, so the window walks forward with the clock and two reads a minute apart do…
windowsbodyreadingView[]Windows is every window instance in range, newest first.
windows[].accountbodystringAccount is the provider-side account the sample belongs to.
windows[].cachedInputTokensbodyintegerCachedInputTokens is the window's cached-prompt-token count.
windows[].confidencebodystringConfidence says whether the counters that remain mean anything, as the meter graded itself.
windows[].costCentsbodyintegerCostCents is the window's spend in cents, as the provider's meter states it.
windows[].costLimitCentsbodyintegerCostLimitCents is the window's spend cap in cents, when the meter knows one.
windows[].currencybodystringCurrency is the ISO currency the cost fields are stated in.
windows[].inputTokensbodyintegerInputTokens is the window's prompt-token count.
windows[].lanebodystringLane names the meter's own lane label for this measurement.
windows[].machinebodystringMachine is the machine the collector observed the account on.
windows[].outputTokensbodyintegerOutputTokens is the window's completion-token count.
windows[].planbodystringPlan is the provider plan label the account is on.
windows[].requestsbodyintegerRequests is the window's request count.
windows[].resetsAtbodystringResetsAt is when the window resets, RFC 3339 UTC.
windows[].syntheticbodybooleanSynthetic marks a sample the collector derived rather than observed.
windows[].totalTokensbodyintegerTotalTokens is the window's total token count.
windows[].usedPctbodynumberUsedPct is how much of the window's allowance is consumed, 0..100.
windows[].windowbodystringWindow is the window class: 6h, day, week or month.
windows[].windowMinutesbodyintegerWindowMinutes is the window's length as the meter reported it.
windows[].windowStartbodystringWindowStart is when the measured window opened, RFC 3339 UTC.

Failure carries the platform error shape — see Errors.

Examples

hanzo links usage get

Link API · All Hanzo APIs · Interactive reference

How is this guide?

On this page