Hanzo
OpenapiLeaderboard

Leaderboard ranks AI usage over a window, either the users of the caller's own…

Leaderboard ranks AI usage over a window, either the users of the caller's own org or organizations against each other, and always reports the caller's…

GET /v1/leaderboard

Addresshttps://api.hanzo.ai/v1/leaderboard
MethodGET
Operationget_leaderboard
AuthAuthorization: Bearer $HANZO_API_KEY

Leaderboard ranks AI usage over a window, either the users of the caller's own org or organizations against each other, and always reports the caller's own standing even when it falls outside the returned page. Identities are private by default: a caller sees themselves, plus the peers or orgs that opted into public listing, and only an admin sees their own org's members named. Cross-org spend is restricted to platform admins. When the warehouse is not connected the board answers empty with available=false rather than a fabricated rank.

Request

4 fields.

FieldInTypeRequiredDescription
scopequerystringScope picks the board: "personal" (default) ranks the caller among their own org's users, "org" is that same org board named for an admin, "global" ranks…
metricquerystringMetric is the value ranked: tokens (default), requests, or cost.
periodquerystringPeriod is the window ranked: day, week, month (default) or all.
limitqueryintegerLimit caps the rows returned, clamped to 100.

Response

StatusBodyMeaning
200LeaderboardViewok

200 body — 28 fields.

FieldInTypeAlwaysDescription
availablebodybooleanAvailable is false when the usage warehouse is not connected or its rollup is not ready.
endbodystringEnd is the EXCLUSIVE upper bound of the window, "2006-01-02" — the day after the last one counted.
metricbodystringMetric echoes the value ranked: tokens|requests|cost.
periodbodystringPeriod is the window's canonical label: day|week|month|all.
rowsbodyLeaderboardRow[]Rows are the ranked subjects, best first, at most the requested limit of them.
rows[].anonymousbodybooleanAnonymous is true when this subject's identity was withheld and Handle is the "Anonymous" placeholder: the metric is real, the name is not.
rows[].costCentsbodyintegerCostCents is this subject's spend in whole US cents (not dollars, not millicents).
rows[].handlebodystringHandle is the display identity to render: the peer's chosen handle if they opted into public listing, their username if the viewer is an admin of their org,…
rows[].metricbodyintegerMetric is the value the board was ranked by, copied from Requests, Tokens or CostCents according to the request's metric.
rows[].rankbodyintegerRank is this subject's 1-based standing in the window, 1 being the top.
rows[].requestsbodyintegerRequests is how many AI requests this subject made in the window.
rows[].selfbodybooleanSelf marks the caller's own row so a client can highlight it in place.
rows[].tokensbodyintegerTokens is prompt+completion tokens this subject spent in the window.
scopebodystringScope echoes the board that was served: personal|org|global.
selfbodySelfRank
self.costCentsbodyintegerCostCents is the caller's own spend in whole US cents.
self.handlebodystringHandle is how the caller appears on this board: their chosen handle, falling back to their username, on a user board; their org id on the global board.
self.listedbodybooleanListed says whether the caller is publicly visible on this board: opted in on a user board, org opted in (or the viewer is a platform admin) on the global one.
self.metricbodyintegerMetric is whichever of the three values above the board was ranked by, so a client can compare the caller against the rows without re-reading the request.
self.ofTotalbodyintegerOfTotal is the size of the universe Rank is out of — "rank N of OfTotal".
self.rankbodyintegerRank is the caller's 1-based standing, computed as (subjects whose windowed metric strictly exceeds the caller's) + 1.
self.rankedbodybooleanRanked is false when the caller holds no position: they had no usage in the window, or (on the global board) their org has not opted into public listing and so…
self.requestsbodyintegerRequests is the caller's own request count in the window, 0 if they were idle.
self.tokensbodyintegerTokens is the caller's own prompt+completion tokens in the window.
sourcebodystringSource names the table these numbers were aggregated from (the derived daily rollup, hanzo.usage_rollup_daily), so an operator can tell exactly what was read.
startbodystringStart is the first day counted, "2006-01-02" inclusive.
subjectbodystringSubject is what the rows stand for — "user" on a personal or org board, "org" on the global one.
totalbodyintegerTotal is how many subjects were ranked in the window — the org's active users, or the active/opted-in orgs on the global board.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.


Leaderboard API · All Hanzo APIs · Interactive reference

How is this guide?

On this page