List route

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
200link.RoutePlanok
defaultproblem-detailsrefused

200 body — 25 fields.

FieldInTypeAlwaysDescription
candidatesbodylink.RouteCandidate[]—Candidates is every linked account in preference order: subscriptions first, then metered api-key accounts as the backstop.
candidates[].accountbodystring—Account is the provider-side account identifier.
candidates[].availablebodyboolean—Available reports whether the candidate is routable right now.
candidates[].billingbodystring—Billing is the cost consequence of dialing this candidate: plan (the user's own subscription) or commerce (the metered gateway path).
candidates[].headroomPctbodynumber (double)—HeadroomPct is the remaining rate-limit capacity, 0..100.
candidates[].hostbodystring—Host is that machine's hostname label.
candidates[].kindbodystring—Kind is how the account authenticates: subscription or apikey.
candidates[].linkIdbodystring—LinkID is the underlying link's opaque handle.
candidates[].machinebodystring—Machine is the machine the account is signed in on.
candidates[].planbodystring—Plan is the provider plan label the account is on.
candidates[].providerbodystring—Provider is the AI provider the candidate account belongs to.
candidates[].reasonbodystring—Reason says why the candidate is not routable, when Available is false.
generatedAtbodystring—GeneratedAt is when the plan was computed, RFC 3339 UTC.
primarybodylink.RouteCandidate—
primary.accountbodystring—Account is the provider-side account identifier.
primary.availablebodyboolean—Available reports whether the candidate is routable right now.
primary.billingbodystring—Billing is the cost consequence of dialing this candidate: plan (the user's own subscription) or commerce (the metered gateway path).
primary.headroomPctbodynumber (double)—HeadroomPct is the remaining rate-limit capacity, 0..100.
primary.hostbodystring—Host is that machine's hostname label.
primary.kindbodystring—Kind is how the account authenticates: subscription or apikey.
primary.linkIdbodystring—LinkID is the underlying link's opaque handle.
primary.machinebodystring—Machine is the machine the account is signed in on.
primary.planbodystring—Plan is the provider plan label the account is on.
primary.providerbodystring—Provider is the AI provider the candidate account belongs to.
primary.reasonbodystring—Reason says why the candidate is not routable, when Available is false.

Failure carries the platform error shape — see Errors.

Examples

hanzo auth link route
import { Configuration, LinkApi } from 'hanzoai';

const api = new LinkApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getLinkRoute();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import LinkApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = LinkApi(client).get_link_route()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.LinkAPI.GetLinkRoute(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, link_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = link_api::get_link_route(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.LinkApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new LinkApi(client).getLinkRoute();
curl https://api.hanzo.ai/v1/link/route \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool link, op get_link_route — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "link",
         "arguments": {
           "op": "get_link_route",
           "input": {}
         }
       }
     }'

Link API · All Hanzo APIs · Interactive reference

Was this page useful?