Hanzo
OpenapiLink

Gets the failover order across your linked accounts.

Gets the failover order across your linked accounts.

GET /v1/link/route

Addresshttps://api.hanzo.ai/v1/link/route
MethodGET
Operationget_link_route
AuthAuthorization: Bearer $HANZO_API_KEY

Gets the failover order across your linked accounts.

It answers an ordered redundancy plan over the caller's LINKED (not revoked) accounts: each candidate with its remaining rate-limit headroom, whether it is routable right now, how it BILLS (plan or commerce), and a reason when it is not — plus the primary to try first. It is what lets a router fail over from one subscription to another and fall back to the metered API as the always-available backstop, knowing the cost consequence before it dials.

It is POLICY, not execution: the plan is computed purely from the usage snapshots already in the registry, never by probing a provider, so it is a total function of the links and costs nothing to ask for. Actually dialing, detecting a live 429 and advancing to the next candidate belongs to the caller. A link with no snapshot counts as full headroom.

Request

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

Response

StatusBodyMeaning
200RoutePlanok

200 body — 25 fields.

FieldInTypeAlwaysDescription
candidatesbodyRouteCandidate[]Candidates is every linked account in preference order: subscriptions first, then metered api-key accounts as the backstop.
candidates[].accountbodystringAccount is the provider-side account identifier.
candidates[].availablebodybooleanAvailable reports whether the candidate is routable right now.
candidates[].billingbodystringBilling is the cost consequence of dialing this candidate: plan (the user's own subscription) or commerce (the metered gateway path).
candidates[].headroomPctbodynumberHeadroomPct is the remaining rate-limit capacity, 0..100.
candidates[].hostbodystringHost is that machine's hostname label.
candidates[].kindbodystringKind is how the account authenticates: subscription or apikey.
candidates[].linkIdbodystringLinkID is the underlying link's opaque handle.
candidates[].machinebodystringMachine is the machine the account is signed in on.
candidates[].planbodystringPlan is the provider plan label the account is on.
candidates[].providerbodystringProvider is the AI provider the candidate account belongs to.
candidates[].reasonbodystringReason says why the candidate is not routable, when Available is false.
generatedAtbodystringGeneratedAt is when the plan was computed, RFC 3339 UTC.
primarybodyRouteCandidate
primary.accountbodystringAccount is the provider-side account identifier.
primary.availablebodybooleanAvailable reports whether the candidate is routable right now.
primary.billingbodystringBilling is the cost consequence of dialing this candidate: plan (the user's own subscription) or commerce (the metered gateway path).
primary.headroomPctbodynumberHeadroomPct is the remaining rate-limit capacity, 0..100.
primary.hostbodystringHost is that machine's hostname label.
primary.kindbodystringKind is how the account authenticates: subscription or apikey.
primary.linkIdbodystringLinkID is the underlying link's opaque handle.
primary.machinebodystringMachine is the machine the account is signed in on.
primary.planbodystringPlan is the provider plan label the account is on.
primary.providerbodystringProvider is the AI provider the candidate account belongs to.
primary.reasonbodystringReason says why the candidate is not routable, when Available is false.

Failure carries the platform error shape — see Errors.

Examples

hanzo links route

Link API · All Hanzo APIs · Interactive reference

How is this guide?

On this page