{"article":{"title":"Routing","breadcrumb":["Upstream channels","Routing"],"body":"**What this solves**: Have a public model name answered by the channel you choose, and set up the primary/backup order, the traffic split, and failover.\n\nRouting decides which channel answers a given model name.\n\nCallers only know:\n\n```json\n{\n  \"model\": \"GLM 5.1\",\n  \"messages\": [...]\n}\n```\n\nWhat routing decides is:\n\n```text\nGLM 5.1\n  ↓\nopenrouter-prod / z-ai/glm-5.1\n  ↓\nIf it fails, fall back to the backup channel\n```\n\nAdding a channel only connects the upstream account. To send real traffic through this channel, you must create a route on the Routing page.\n\nConsole entry point: **Routing**.\n\n### What a route contains\n\nWhen you add a route, you fill in these fields:\n\n| Field | Meaning |\n|---|---|\n| Model | The model name callers use when they request Tare |\n| Upstream name | The model name the upstream actually recognizes |\n| Channel | The channel this route goes through |\n| Tier / Priority | Primary or backup |\n| Weight | Traffic share within the same tier |\n| Enabled | Whether it is enabled |\n\nExample:\n\n```text\nModel = GLM 5.1\nChannel = openrouter-prod\nUpstream name = z-ai/glm-5.1\nTier = Primary\nWeight = 1\n```\n\nThis means: when a caller requests `GLM 5.1`, Tare sends it to `openrouter-prod` and changes the upstream model name to `z-ai/glm-5.1`.\n\n### The difference between Model and Upstream name\n\nThis is the most confusing part of routing.\n\n| Name | Who sees it | Example |\n|---|---|---|\n| Model | Your service, your downstream users, the Tare API | `GLM 5.1` |\n| Upstream name | The upstream provider | `z-ai/glm-5.1` |\n\nIf both names are the same, you can leave Upstream name empty to mean \"use the same name\".\n\nIf the upstream is an aggregator gateway, it is usually best to explicitly select or enter the upstream model name, so that a misspelled model name is caught early, rather than only at call time.\n\n### Configure the simplest route\n\nPrerequisite: you have already added a channel on the Channels page and it passed the test.\n\n1. Open **Routing**.\n2. Click **Add route** and fill in **Model**, for example `GLM 5.1`.\n3. Select **Channel**, for example `openrouter-prod`.\n4. In **Upstream name**, select or enter the upstream model, for example `z-ai/glm-5.1`.\n5. Set **Tier** to `Primary`.\n6. Leave **Weight** at `1`.\n7. Click **Add**.\n8. Send one real request with a business key to verify.\n\n### Override a platform default model\n\nIf the Model name you create is the same as a platform default model, your own route takes over first. The platform route does not disappear; it stays behind as a fallback: if your provider fails, this model does not go down with it.\n\nExample:\n\n```text\nPlatform already has: GPT-5.6 Sol\nYou add: GPT-5.6 Sol -> openrouter-prod / openai/gpt-5.6\n```\n\nAfter that, when you call `GPT-5.6 Sol`, it goes through your channel first. If your channel fails, the platform default model may still serve as a fallback, depending on that Router's platform model switch.\n\nWhich upstream sits behind a platform default model is managed by the platform and can change without notice. If you need to control it, add your own route under the same name.\n\n### Route to a Tare model\n\nIn the **Channel** dropdown, **Tare** sends the route to one of the platform default models, which you pick as the target. You don't need a channel of your own for this. Use it to:\n\n- put a Tare model in the same tier as your channels and split traffic by weight, or make it the primary or the fallback;\n- give a Tare model a name of your own. For example, calls to `fast` go to `qwen/qwen3.7-flash`.\n\nCalls are charged at the Tare price of the target model, also under a name of your own. Usage records show the name you called. The weight you give the row covers Tare as a whole.\n\n### Priority / Tier\n\nPriority is the primary/backup order; the smaller value goes first. The console shows it as the easier-to-read Tier:\n\n| Tier | Meaning |\n|---|---|\n| Primary | Primary tier, tried first |\n| Fallback 1 | First backup tier |\n| Fallback 2 | Second backup tier |\n\nA single model can have multiple routes:\n\n![Routing primary and backup tiers](diagram:en-routing-priority-tier)\n\nOnly when the current tier is entirely unavailable does it move to the next tier.\n\nIf you add a route and choose \"New fallback\", or do not specify a priority, it lands in a new tier after the current highest tier, never 0, so it never quietly steals primary traffic. Adding a fourth backup will never silently steal traffic from the three already running.\n\n### Weight\n\nWeight only applies within the same Tier, and is used to split traffic.\n\nExample:\n\n```text\nPrimary:\n  openrouter-a weight = 9\n  openrouter-b weight = 1\n```\n\nThis roughly means that out of 10 sessions, 9 go to `openrouter-a` and 1 goes to `openrouter-b`.\n\nTraffic is split by session, not by individual call: one session (one conversation) stays on the same channel, so upstream and subscription caches hit more often. It moves to another channel in the same tier only when its channel fails, its circuit opens or it sells out. A session is recognized by the `X-Claude-Code-Session-Id`, `Session-Id` or `X-Session-Id` header, or by `prompt_cache_key`, `metadata.user_id` or `user` in the body; Claude Code and Codex send these on their own. With none of them, the API key decides: calls with the same key go to the same channel.\n\n![Traffic split by weight within a tier](diagram:en-routing-weight)\n\nNote:\n\n- 9 to 1 is the same ratio as 90 to 10.\n- This assumes both channels are equally fast. When one channel is clearly slower than the fastest channel for the same model, the configured weight is scaled down proportionally (see \"Automatic down-weighting of slow channels\" below), so the traffic split you actually observe is looser than what you configured, even if neither channel is unhealthy.\n- The minimum Weight is 1.\n- Weight = 0 does not mean paused.\n- To pause a route, turn off Enabled instead of setting Weight to 0.\n\n### Smart arrangement\n\nThe Routing page supports one-click reordering for a model (open the model, then **Fastest first** or **Cheapest first**):\n\n- Sort by measured latency.\n- Sort by provider cost price.\n\nIt only runs once when you click it, and does not stay running. Routes added afterward do not get reordered automatically; you need to click again.\n\nFor the default Router, use:\n\n```text\nPOST /v1/routing/routes/arrange\n```\n\nFor a named Router, use:\n\n```text\nPOST /v1/routers/{id}/routes/arrange\n```\n\n### Route testing\n\nA route can be tested on its own: open the model and choose **Test** from the route's **⋯** menu.\n\nThis test checks one more thing than a channel test does: besides checking the address, the credential, and the Dialect (the differences between providers' APIs), it also checks whether the upstream model name this route points to exists. The first three are the same three checks as in [testing a channel](channels); the last one is unique to routes.\n\nRelated operations:\n\n| Operation | Default Router | Named Router |\n|---|---|---|\n| Test a route | `POST /v1/routing/routes/{routeId}/test` | `POST /v1/routers/{id}/routes/{routeId}/test` |\n| Send a one-liner through a route | `POST /v1/routing/routes/{routeId}/chat` | Corresponds to `/v1/routers/{id}/...` |\n\nThese two diagnostic calls are not counted in your Tare bill and do not appear in Call Traces.\n\n### Parameter handling (Parameter rules)\n\nThe same model on a different upstream may accept different parameters: one ignores `temperature`, another rejects a value of `thinking.type`, a third wants `output_config.effort` set to one fixed value. You set this per channel and upstream model: on the Routing page, open the model and choose **Parameter rules** from the **⋯** menu of a route on your own channel.\n\nCommon parameters are listed in the channel's own API format, each with three options:\n\n| Option | Effect |\n|---|---|\n| As sent | Forwarded as the client sent it (default) |\n| Don't send | Not forwarded to this upstream |\n| Fixed | Set to the value you give, even when the client did not send it |\n\n| Parameter | Fixed values | Upstream field |\n|---|---|---|\n| `temperature` | 0–2 | `temperature` (Gemini: `generationConfig.temperature`) |\n| `thinking.type` | `enabled` / `disabled` / `adaptive` | `thinking.type`; Don't send removes the whole `thinking` object |\n| `effort` | `minimal` / `low` / `medium` / `high` / `xhigh` / `max` | Anthropic `output_config.effort`, OpenAI `reasoning_effort`, Responses `reasoning.effort` |\n| `cache_control` | Don't send only | Every `cache_control` in system, tools and messages; Tare also stops adding cache breakpoints for this route |\n\nFor anything else, click **+ Field** and give a field path (such as `top_k` or `extra_body.enable_search`): don't send it, fix it, or \"Remove everywhere\" (delete that key at any depth in system, tools and messages).\n\nThe rewrite runs on the request sent to that upstream, in its API format, and touches only the fields you set; message content is unchanged, and so are cache breakpoints unless you set `cache_control`. Tare may handle the same parameter by default; your setting takes precedence. Changes take effect within a minute. What was changed on a call shows in that call's parameter changes in Call Traces.\n\nOn channels whose API format is Anthropic, Tare can add cache breakpoints where the request has none: the last tool, the end of the system prompt, and the last message, at most 4 in total. This is off by default; to turn it on for a channel, edit the channel and check **Add prompt cache breakpoints automatically**. Breakpoints you send are kept as they are either way.\n\nAPI: `GET /v1/param-rules` lists every rule you have set; `PUT /v1/param-rules` replaces the set for one channel and upstream model (an empty array clears it):\n\n```json\n{\"providerId\": 12, \"providerModelName\": \"claude-opus-4.7\", \"rules\": [\n  {\"field\": \"temperature\", \"action\": \"DROP\"},\n  {\"field\": \"output_config.effort\", \"action\": \"SET\", \"value\": \"high\"},\n  {\"field\": \"cache_control\", \"action\": \"STRIP\"}\n]}\n```\n\n`action` is `DROP` (don't send), `SET` (fixed value), `CALIBRATE` (change it only when the client sent it) or `STRIP`; fields use the channel's API format.\n\n### Failover\n\nA failed call almost always moves on to the next candidate. The one clear exception is when your own client disconnects halfway through the request. In that case the failover stops immediately; continuing would just generate an answer nobody will read.\n\n| What happened | Moves to the next channel | Counts toward this channel's health |\n|---|---|---|\n| Client disconnected | No | No |\n| Malformed request 400 / 413 / 422 | Yes | No |\n| Credential rejected 401 / 403 | Yes | Yes |\n| Upstream has no such model 404 | Yes | Yes |\n| Upstream rate limited 429 | Yes | Yes |\n| Upstream 5xx or timeout | Yes | Yes |\n\nThe diagram below applies to candidate attempts before the first byte is returned. Once streaming content starts returning, there is no more failover; for billing after an interruption, see [Billing rules](billing).\n\n![Whether a failure moves on to the next channel](diagram:en-routing-failover)\n\n> [!NOTE]\n> Malformed requests still fail over. Some proxy providers also report a failure on their own upstream as an ordinary 400; judging \"no failover\" by status code alone would leave a perfectly healthy second channel sitting idle while your call fails outright.\n>\n> But it does not count toward this channel's health: a batch of requests broken by your own bad release should not be enough to push a channel that has never actually had a problem into parked status.\n\nThere is no limit on the number of candidates a call will try. Four backups configured means four attempts; whether the extra few hundred milliseconds is worth it is your own trade-off when you add a fourth route. There is an emergency cap that is enabled only for a very small number of accounts with abnormal candidate configurations, off by default; for how billing works once it is hit, see [Billing rules](billing).\n\nEvery attempt can be seen in [Call Traces](content-retention): succeeded, blocked, failed, or never tried at all (which appears only when the emergency cap on the account is in effect).\n\n#### Circuit breaker\n\nA channel trips the circuit breaker after 5 counted failures:\n\n1. Cool down for 30 seconds first; no new traffic is sent during this time.\n2. When the cooldown expires, allow exactly one real request as a trial.\n3. If it succeeds, fully recover.\n4. If it fails, double the cooldown and wait again.\n5. The cooldown is capped at 300 seconds.\n\n![How a channel recovers after the circuit breaker trips](diagram:en-routing-circuit-breaker)\n\n> [!NOTE]\n> This trial is a real call. On a BYOK channel it uses your own credential; it sets `max_tokens: 1` to keep the cost negligible, and it probes at most once per cooldown cycle, not on every check.\n>\n> Without this, a channel that has recovered would stay locked out until real traffic happened to prove it works; for an account with only one channel configured, that would mean an outage that never ends on its own.\n\n#### Automatic down-weighting of slow channels\n\nWhether or not the caller passes `provider.sort`, a channel that is more than 3 times slower than the fastest channel for the same model is treated as if it were unhealthy: it sinks below normal channels but is never fully removed (a slow answer is better than no answer), and, per the weight note above, it gets only a smaller share of traffic within its own tier.\n\n#### Two different health pages\n\n| Page | Endpoint | Who can see it | Granularity |\n|---|---|---|---|\n| Model Health | `GET /v1/health/models` | Everyone | Reports up / degraded per **model** |\n| Channel health | `GET /v1/health/channels` | Only BYOK channel owners | Names each of your own channels |\n\nModel Health's data comes from your own recent traffic, and it never names providers, because which providers sit behind a model is the platform's business information. On its own it only ever says up or degraded.\n\nThe parked state appears only on the channel health page. See \"Viewing the health of your own channels\" in [Channels](channels).\n\n- No traffic in the window means no data, not \"healthy\". A model you rarely call shows few samples.\n- A model is marked degraded when its failure rate in the window crosses the threshold. Requests to it are still routed.\n- A parked channel comes back on its own once a trial request succeeds (see \"Circuit breaker\" above).\n- The channel timeline shows when each channel went out of service and came back, not individual failed requests. Platform channels are not listed.\n- The pages refresh every 30 seconds.\n\n### Catch-all route\n\nA route whose model name is `*` is a catch-all route; it handles all models that have not been configured by name, instead of returning \"no route configured\".\n\n`Upstream name` has two meanings in a catch-all route:\n\n| Upstream name | Behavior |\n|---|---|\n| Empty | Forwards the caller's requested model name to the upstream as-is |\n| Filled in | All unconfigured models are answered by this one upstream model instead |\n\nA typical configuration for an aggregator gateway:\n\n```text\nModel = *\nChannel = openrouter-prod\nUpstream name = (empty)\n```\n\nThis way, when a caller requests an unconfigured model such as `anthropic/claude-...` or `openai/gpt-...`, the model name is passed to OpenRouter as-is.\n\nUpstream name is a dropdown that lists the models you have configured on the selected channel (the ones with a recorded cost price, see [Cost prices](cost-prices)). A typo in this field does not raise an error: the route is still created, and the mistake only shows up when the upstream rejects the call. Choosing **Something else…** lets you type a name not in the list; private deployments and aliases are legitimate uses, and this path is always kept open.\n\n> [!WARNING]\n> The catch-all only applies when a model has no routes at all. When a model is configured but all its channels fail, the call fails rather than silently switching to another provider; otherwise you would receive another model's output under the model name you requested, with nothing anywhere saying so.\n\nChanges to the catch-all route take effect within a minute, because already-resolved models have a short cache.\n\n### Platform model switch\n\nThis group of settings has one switch, **`enablePlatformModels`** (shown in the console as Scope → **Use platform models**). For the default Router, change it with `PUT /v1/routing/settings`; for a named Router, use `PUT /v1/routers/{id}` (the same field name). A newly created Router is on by default.\n\nWhen on:\n\n- Platform shared models are available.\n- Your own same-named route takes priority, and the platform route can serve as a fallback behind it.\n\nWhen off:\n\n- Every key bound to this Router can no longer see platform models. For the default Router, that means all child keys under the account that have not been individually bound to another Router.\n- `GET /v1/models` no longer returns platform models.\n- These keys can only use the routes you have configured yourself.\n\nFor these keys, it takes effect from their next call; calls already sent are not retracted.\n\nThe read endpoint for this group of settings is `GET /v1/routing`.\n\n### Allow models with no route\n\nScope also has **Allow models with no route**.\n\nWhen on, model names with no explicit route can be forwarded as-is to the Passthrough channel you designate.\n\nWhen off, models with no route return 404.\n\nThis is very similar to the `*` catch-all route, but it appears in the console as a Router-level setting. Note: it depends on a specific passthrough channel, and takes effect within a minute after you toggle it.\n\n### Routes for one key\n\nRoutes apply to all keys by default. To send one key somewhere else, pick it in the selector next to **Routes** (it reads **All keys** until you change it) (or use the route icon next to the key on API Keys), then add routes as usual.\n\n- A model the key has its own routes for runs only on those routes for that key. The routes all keys follow are not mixed in.\n- Every other model follows the routes all keys follow, and changes there apply to this key too.\n- Billing, **Use platform models** and **Allow models with no route** are account settings and stay the same for every key.\n- Removing the key's last route for a model puts that model back on the routes all keys follow.\n\nOver the API, pass `apiKeyId` to `GET /v1/routing` (only that key's own routes come back in `myRoutes`), to `POST /v1/routing/routes` and to `POST /v1/routing/routes/arrange`. Editing or removing a route by id needs no `apiKeyId`. `GET /v1/routing` also returns `keyOverrides`: which keys have routes of their own and for which models.\n\nA key bound to a named Router (below) cannot also have routes of its own; unbind it first.\n\nA [provisioning key](provisioning) can have routes too, the same way. They are for the child keys it issues: a child key with no routes of its own follows its master key's routes, and every model the master key has no routes for follows the routes all keys follow. Such a child key's routes are changed on its master key, not on the child key; `GET /v1/routing?apiKeyId=<child key>` says which master key it follows in `inheritsFrom`.\n\n### An account can have multiple Routers\n\nBy default, the Routing page edits the account's default Router. For the vast majority of accounts, that is all you need.\n\nLook one level deeper: that default routing is really a Router, and an account can have more than one. Useful in advanced scenarios:\n\n- Test keys go through cheap models.\n- Production keys go only through stable providers.\n- A given customer is allowed to use only specified channels.\n- Different projects have different fallback strategies.\n\n![An account can have multiple Routers](diagram:en-routing-multi-router)\n\nRelated endpoints:\n\n| Operation | Endpoint |\n|---|---|\n| List / create Routers | `GET` / `POST /v1/routers` |\n| Modify / delete a Router | `PUT` / `DELETE /v1/routers/{id}` |\n| Bind an API key to a Router | `POST /v1/api-keys/bind-router` |\n| List routes of a named Router | `GET` / `POST /v1/routers/{id}/routes` |\n| Modify / delete a named Router's route | `PUT` / `DELETE /v1/routers/{id}/routes/{routeId}` |\n\nA named Router also has its own full set of routes, with priority, weight, and catch-all rules exactly the same as the default Router. Testing and smart arrangement work the same way too: `POST /v1/routers/{id}/routes/{routeId}/test` and `POST /v1/routers/{id}/routes/arrange`.\n\nA key with no Router bound uses the account's default Router.\n\n### Caller-specified backup models for one request: `models`\n\nEverything above is configured once on the Routing page and applies to all calls. `models` is the same idea, but handed to the caller, and applies only to this one call.\n\n```json\n{\n  \"model\": \"GLM 5.1\",\n  \"models\": [\"GPT-5.6 Sol\", \"Claude Opus 5\"],\n  \"messages\": []\n}\n```\n\nExecution order:\n\n1. `model` is still required, and is always tried first. It carries all of its configured routes, priority, weight, and catch-all route, exactly as if there were no `models`.\n2. Only after all routes for `model` are exhausted (not configured at all, or configured but all candidates have tripped the circuit breaker / failed) does it fall back to `models[0]`.\n3. If that still fails, it tries `models[1]`.\n\nAt most 5 backup models; anything beyond that is silently dropped, with no error.\n\nThe `model` field in the response and the price you are charged both reflect the model that actually answered. If the call ends up on `\"Claude Opus 5\"`, that is what the response says, not the one you wrote first.\n\n> [!WARNING]\n> `models` is consumed by Tare itself and is never forwarded upstream. It shares a name with a field OpenRouter recognizes; forwarded as-is, OpenRouter would take model names that mean nothing to it and run its own failover logic.\n\n### Caller-specified channel preferences for one request: `provider`\n\nYou can pass `provider` in a request to adjust the candidate channels for just this one call, without editing the Routing page.\n\n```json\n{\n  \"model\": \"GLM 5.1\",\n  \"provider\": {\n    \"order\": [\"openrouter\"],\n    \"only\": [\"openrouter\", \"our-own-channel\"],\n    \"allow_fallbacks\": false,\n    \"sort\": \"latency\"\n  },\n  \"messages\": []\n}\n```\n\n| Field | Effect |\n|---|---|\n| `order` | Tries these channel names first, in this order; unless `allow_fallbacks` is turned off, the remaining resolved candidates follow behind |\n| `only` | An allowlist; all other channels are removed from the candidate list |\n| `ignore` | A blocklist; removes these channels |\n| `allow_fallbacks` | Defaults to `true`. When set to `false`, only channels named by `order`/`only` are allowed; if none of them can be reached, the call fails outright and no others are tried |\n| `sort` | `\"latency\"` reorders by measured average latency, fastest to slowest, using the same data that default route ordering already uses |\n\nChannel name matching is case-insensitive and compares against the name shown on the Channels and Routing pages.\n\n> [!WARNING]\n> If `only`/`ignore`/`order` filter the candidates down to none, the response is 400, not 404. This distinguishes \"your preferences excluded all candidates\" from \"this model has no route\". The error message lists which channels this model actually has configured, so you can check whether a name was misspelled.\n\n> [!NOTE]\n> `sort: \"price\"` and `sort: \"throughput\"` are accepted but currently have no effect. Many OpenRouter-compatible clients send these two values by default; rejecting calls because they are unsupported would drag down a batch of requests that have nothing to do with this field. `price` also genuinely has no meaning right now: platform pricing is set per model, not per channel, so different channels for the same model have the same price, and there is no price to sort by.\n\nLike `models`, the `provider` object is consumed by Tare and does not reach your upstream.\n\n### How much time a failover takes\n\nWhen a call actually failed over between channels, `GET /v1/generation` (see [Endpoints](endpoints)) reports `latency` and `generation_time` separately:\n\n- `generation_time` is the time taken by the provider that actually answered.\n- `latency` adds to that the time taken by each failed attempt before the failover.\n\nThe difference between the two, `routing_overhead_ms`, appears only when a failover actually happened, so you can tell \"this model is just slow\" from \"the request first hit a dead channel\" without digging into call details.\n\n### Multimodal\n\nA route can declare which input types its channels accept; requests with images are sent only to routes that declare they accept images.\n\nRoutes that do not declare anything are not excluded. \"Undeclared\" is treated as \"unknown, do not exclude\"; otherwise, the moment this field is enabled, all image requests would lose all their candidates at once.\n\n> [!NOTE]\n> This cannot be self-configured yet: the route-editing endpoint does not have an input type field. If a route needs to declare this, contact us.\n\n### Local Nodes and routing\n\nChannels on a customer Local Node follow the same rules: Priority sets the order, and within a tier sessions are spread across channels by Weight. Success and failure the node reports update channel health.\n\nIf the node is down, a call that connects to the node directly fails. Tare's servers do not send it for you. To stay on the server path, leave the channel unmarked as `LOCAL_NODE`.\n\nIf you do not want to run your own, use the official node at `https://tare-node.jamerly.ai`. It is not in your network. See [Local Nodes](local-nodes).\n\n### SOP: Add a stable route\n\n1. On the Channels page, confirm the channel has been added.\n2. Run Test and Chat on the channel.\n3. In Cost prices, confirm the target upstream model exists, or confirm the upstream will report the real cost in its response.\n4. Open Routing.\n5. Fill in the public Model name.\n6. Select the Channel.\n7. Select or enter the Upstream name.\n8. Set the first route to Primary and leave weight at 1.\n9. Set the second and later backup routes to Fallback.\n10. Run the test on each route.\n11. Send a real request with a business key.\n12. In Call Traces or a generation query, confirm the model, channel, latency, and cost actually hit.\n\n### Minimum acceptance checklist\n\n- [ ] Every public model name has the route you expect.\n- [ ] The naming boundary between Model and Upstream name is clear.\n- [ ] The Primary / Fallback order matches what the business expects.\n- [ ] The Weight ratio within a tier matches expectations.\n- [ ] Routes you want to pause use the off switch, not weight set to 0.\n- [ ] The catch-all route or passthrough setting is explicitly on/off.\n- [ ] The platform model switch matches the current Router's business scope.\n- [ ] Route tests pass.\n- [ ] The `model` returned by real calls and the channel hit match expectations.\n\n### Next steps\n\nThese three articles form one chain, read in order: connect a channel → record cost prices → configure routing. You have now finished the third step.\n\n- Previous step: if you have not recorded cost prices yet, read [Cost prices](cost-prices).\n- The step before that: if you have not connected a channel yet, read [Channels](channels).\n- To have BYOK call the upstream directly from your own network: read [Local Nodes](local-nodes).\n- To see which route each call actually hit: read [Call Traces](content-retention).\n- If you run into a word you do not know: check the [Glossary](glossary).\n"},"diagrams":{"en-routing-priority-tier":"<svg viewBox=\"0 0 424 425\" width=\"424\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>Primary and backup tiers</title>\n  <desc>One public model name is tried Primary, then Fallback 1, then Fallback 2. The next tier is used only when the current tier is entirely unavailable.</desc>\n  <style>\n    text { font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }\n  </style>\n  <defs>\n    <marker id=\"arrow-blue\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#3b82f6\"/>\n    </marker>\n    <marker id=\"arrow-orange\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#f59e0b\"/>\n    </marker>\n    <marker id=\"arrow-green\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#22c55e\"/>\n    </marker>\n  </defs>\n\n  <!-- 浅色画布：图被贴到深色页面上时，仍然读作一张白卡片 -->\n  <rect x=\"0\" y=\"0\" width=\"424\" height=\"425\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术在任何坐标落笔之前就定死了。\n       四行同宽同高：宽 300、高 54（两行：12 x 3 + 18），x = 102..402，行心 x = 252。\n       行距一律 28px，于是四行顶边依次是 60 / 142 / 224 / 306，底边 114 / 196 / 278 / 360。\n       左侧放转移条件的标注，右对齐到 x = 82，与框体左沿留 20px。\n       最长的标注是「本层全不可用」= 6 x 10 = 60px，占 22..82，\n       所以内容左边界是 22、右边界是 402，内容中心 = (22 + 402) / 2 = 212。\n       viewBox 宽 = 全部内容宽 380 + 两侧各 22px 边距 = 424。\n       注意两套中心不是同一个：viewBox 边距按「全部内容」（含左侧标注）算，\n       于是 22..402 左右各 22px 对称；而标题的居中基准按「图形」包围盒算，\n       左侧那列标注是文字、不参与，所以标题落在框体的中心 252，不是 212。\n       高度 = 脚注第二行基线 400 + 下伸 2.5 + 22px 边距 = 424.5，取整 425。 -->\n\n  <!-- 标题落在框体中心 252。y = 22 + 16 x 0.75 -->\n  <text x=\"252\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">One model name, tier by tier</text>\n\n  <!-- 第 1 层：连线。竖向运行：起点 = 源框底边 + 5，终点 = 目标框顶边 - 11，\n       留 12px 可见线。每条连线带着它离开的那个框的描边色。 -->\n  <path d=\"M252,119 L 252,131\" fill=\"none\" stroke=\"#3b82f6\" stroke-width=\"1.5\" marker-end=\"url(#arrow-blue)\"/>\n  <path d=\"M252,201 L 252,213\" fill=\"none\" stroke=\"#f59e0b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-orange)\"/>\n  <path d=\"M252,283 L 252,295\" fill=\"none\" stroke=\"#22c55e\" stroke-width=\"1.5\" marker-end=\"url(#arrow-green)\"/>\n\n  <!-- 转移条件写在 28px 的通道里、连线的左侧，右对齐到 82。\n       基线 = 通道中线 + 10 x 0.35，所以通道 114..142 上的标注落在 131.5。\n       标注与上下框体各有 10px 与 8px 的竖直净空，与连线的水平距离 170px。 -->\n  <text x=\"82\" y=\"131.5\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"end\">Try main</text>\n  <text x=\"82\" y=\"213.5\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"end\">All down</text>\n  <text x=\"82\" y=\"295.5\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"end\">All down</text>\n\n  <!-- 第 2 层：方框和文字，盖住线头。\n       两行框的基线 = 框心 + 12 x 0.35 再上下各让 9px，于是 60 起的框落在 82 / 100。\n       蓝是「输入」那一组：调用方请求的模型名。 -->\n  <rect x=\"102\" y=\"60\" width=\"300\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"252\" y=\"82\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">GLM 5.1</text>\n  <text x=\"252\" y=\"100\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">The name the caller requested</text>\n\n  <!-- 橙是「处理中」那一组，也是这张图的焦点：正常流量走的就是这一层。 -->\n  <rect x=\"102\" y=\"142\" width=\"300\" height=\"54\" rx=\"6\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"252\" y=\"164\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">Primary tier</text>\n  <text x=\"252\" y=\"182\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">openrouter-prod</text>\n\n  <!-- 绿是「备选」那一组。两条备用同色：它们语义上是同一件事，只是先后不同；\n       给两种颜色反而会暗示两种不同的角色。 -->\n  <rect x=\"102\" y=\"224\" width=\"300\" height=\"54\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"252\" y=\"246\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">Fallback 1, first backup</text>\n  <text x=\"252\" y=\"264\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">gateway-sg</text>\n\n  <rect x=\"102\" y=\"306\" width=\"300\" height=\"54\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"252\" y=\"328\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">Fallback 2, second backup</text>\n  <text x=\"252\" y=\"346\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">local-node-office</text>\n\n  <!-- 脚注两行，同为 10px、行距 15px，与标题同一条中轴 252。 -->\n  <text x=\"252\" y=\"385\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Choose New fallback, or omit priority.</text>\n  <text x=\"252\" y=\"400\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">New tier after the highest. Primary traffic stays put.</text>\n</svg>\n","en-routing-weight":"<svg viewBox=\"0 0 579 264\" width=\"579\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>Weight splits traffic inside one tier</title>\n  <desc>Inside one tier, weight splits traffic. A 9 to 1 pair sends about 9 of 10 calls to the first channel. A channel more than 3 times slower is down-weighted. Minimum weight is 1.</desc>\n  <style>\n    text { font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }\n  </style>\n\n  <!-- 浅色画布：图被贴到深色页面上时，仍然读作一张白卡片 -->\n  <rect x=\"0\" y=\"0\" width=\"579\" height=\"264\" fill=\"#ffffff\"/>\n\n  <!-- 条形图的算术在任何坐标落笔之前就定死了。\n       一个权重单位 = 40px，于是 weight 9 的条长 360、weight 1 的条长 40，比例一眼可读。\n       三列自上而下排：渠道名右对齐到 x = 106（最长 84px，占 22..106），\n       条形从 x = 126 起（与名字留 20px），数值紧跟条尾 15px。\n       weight 9 的数值落在 501..557，所以内容左右边界是 22..557，中心 289.5；\n       viewBox 宽 = 535 + 两侧各 22 = 579，边距按「全部内容」算，左右各 22px 对称。\n       而标题与脚注的居中基准按「图形」包围盒算（文字不参与），\n       图形只有那两根条：126..486，中心 306，所以标题落在 306 而不是 289.5。\n       行距一律 28px：条一 84..120，条二 148..184。\n       高度 = 脚注末行基线 239 + 下伸 2.5 + 22px 边距 = 263.5，取整 264。 -->\n\n  <!-- 标题落在条形包围盒的中心 306。y = 22 + 16 x 0.75 -->\n  <text x=\"306\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">Inside one tier, weight splits traffic</text>\n\n  <!-- 层说明：这一句界定条形适用的范围，10px 次级色，落在标题与条形之间 -->\n  <text x=\"306\" y=\"60\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Inside Primary, weight applies only in that tier</text>\n\n  <!-- 两根条同色：它们语义上是同一件事，都是这个模型下的候选渠道；\n       给两种颜色反而会暗示两种不同的角色。绿是「渠道」那一组。 -->\n  <rect x=\"126\" y=\"84\" width=\"360\" height=\"36\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <rect x=\"126\" y=\"148\" width=\"40\" height=\"36\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n\n  <!-- 渠道名与数值都在框外，基线 = 条形中线 + 12 x 0.35，\n       所以 84..120 那条落在 106，148..184 那条落在 170。 -->\n  <text x=\"106\" y=\"106\" font-size=\"12\" fill=\"#166534\" text-anchor=\"end\">openrouter-a</text>\n  <text x=\"501\" y=\"106\" font-size=\"12\" fill=\"#166534\">weight 9</text>\n  <text x=\"106\" y=\"170\" font-size=\"12\" fill=\"#166534\" text-anchor=\"end\">openrouter-b</text>\n  <text x=\"181\" y=\"170\" font-size=\"12\" fill=\"#166534\">weight 1</text>\n\n  <!-- 脚注三行，同为 10px、行距 15px，与标题同一条中轴 306。 -->\n  <text x=\"306\" y=\"209\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">About 9 of 10 sessions go to openrouter-a, and 1 to openrouter-b</text>\n  <text x=\"306\" y=\"224\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">A channel 3x slower is down-weighted, so the live split is looser</text>\n  <text x=\"306\" y=\"239\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Minimum weight is 1. To pause a route, turn it off. 0 is not off.</text>\n</svg>\n","en-routing-failover":"<svg viewBox=\"0 0 670 261\" width=\"670\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>After a failure, does the next channel run?</title>\n  <desc>Before the first byte, a failed try has three outcomes: a client disconnect stops failover, a bad request shape fails over without a health hit, and a provider-side failure fails over and counts toward health.</desc>\n  <style>\n    text { font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }\n  </style>\n  <defs>\n    <marker id=\"arrow-grey\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#64748b\"/>\n    </marker>\n  </defs>\n\n  <!-- 浅色画布：图被贴到深色页面上时，仍然读作一张白卡片 -->\n  <rect x=\"0\" y=\"0\" width=\"670\" height=\"261\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术在任何坐标落笔之前就定死了。\n       下面三条并列的框各宽 190、间距 28：22..212 / 240..430 / 458..648，\n       所以内容左右边界是 22..648，宽 626，中心 335。\n       viewBox 宽 = 626 + 两侧各 22 = 670，边距按「全部内容」算，左右各 22px 对称。\n       三条框的居中基准同为 335（图形包围盒也是 22..648），标题与脚注都落在 335。\n       根框落在中间那条的正上方，同为 190 宽（240..430），中心 335，与三条框形成对称扇形。\n       行距一律 28px：根框 60..96（单行，高 36），三条框 124..196（三行，高 12 x 3 + 2 x 18 = 72）。\n       高度 = 脚注末行基线 236 + 下伸 2.5 + 22px 边距 = 260.5，取整 261。 -->\n\n  <!-- 标题落在内容中心 335。y = 22 + 16 x 0.75 -->\n  <text x=\"335\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">After a failure, does the next channel run?</text>\n\n  <!-- 第 1 层：连线。左右两条从根框的侧边出发，不从底边掉下来 ——\n       根框只有 240..430 宽，而两侧目标中心在 117 和 553，从底边出发的竖线会悬在框外。\n       每个末段控制点都与终点同 x（117 / 553），末端切线因此竖直向下，\n       箭头正对框顶而不是斜着扎进去。起点离源框 5px、终点离目标框 11px。 -->\n  <path d=\"M235,78 C 180,78 117,90 117,113\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-grey)\"/>\n  <path d=\"M335,101 L 335,113\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-grey)\"/>\n  <path d=\"M435,78 C 490,78 553,90 553,113\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-grey)\"/>\n\n  <!-- 第 2 层：方框和文字，盖住线头。\n       三行框的基线 = 框心 + 12 x 0.35 上下摊开，12px 标题到 10px 副行隔 18px、\n       两条 10px 行之间隔 15px，于是 124 起的框落在 147 / 165 / 180。 -->\n  <rect x=\"240\" y=\"60\" width=\"190\" height=\"36\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"335\" y=\"82\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">Failed before first byte</text>\n\n  <!-- 左边这条是唯一的例外：请求进行到一半客户端自己断开，继续转移只是在生成没人看的答案。\n       粉是「敏感 / 警告」那一组，也是这张图里唯一需要读者记住的分支。 -->\n  <rect x=\"22\" y=\"124\" width=\"190\" height=\"72\" rx=\"6\" fill=\"#fce7f3\" stroke=\"#ec4899\"/>\n  <text x=\"117\" y=\"147\" font-size=\"12\" fill=\"#9d174d\" text-anchor=\"middle\">Client disconnected</text>\n  <text x=\"117\" y=\"165\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">Stop. Do not switch.</text>\n  <text x=\"117\" y=\"180\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">Not a health hit</text>\n\n  <!-- 中间与右边两条都「转移」，区别只在算不算健康度，所以两条同色（绿 = 渠道那一组），\n       差异交给第三行文字去说，而不是交给颜色 —— 颜色一多，读者会以为它们是两类东西。\n       「供应商侧失败」这个合并名是落档时取的：原文的故障转移表把 401/403、404、429、\n       5xx·超时 分成四行，四行的主体都是「供应商」，且结论一致（都转移、都计入健康度），\n       所以合为一框。表里没有给这一组合起名，名字出自这四行的共同主体。 -->\n  <rect x=\"240\" y=\"124\" width=\"190\" height=\"72\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"335\" y=\"147\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">Bad request shape</text>\n  <text x=\"335\" y=\"165\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">400 · 413 · 422</text>\n  <text x=\"335\" y=\"180\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">Move on. Not a health hit.</text>\n\n  <rect x=\"458\" y=\"124\" width=\"190\" height=\"72\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"553\" y=\"147\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">Provider-side failure</text>\n  <text x=\"553\" y=\"165\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">401 403 404 429 5xx timeout</text>\n  <text x=\"553\" y=\"180\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">Move on, and count health</text>\n\n  <!-- 脚注两行，同为 10px、行距 15px，与标题同一条中轴 335。 -->\n  <text x=\"335\" y=\"221\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Bad shapes still fail over. Some relays report their own outage as a plain 400.</text>\n  <text x=\"335\" y=\"236\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">They are not a health hit. A bad client release should not park a good channel.</text>\n</svg>\n","en-routing-circuit-breaker":"<svg viewBox=\"0 0 610 302\" width=\"610\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>How a channel recovers after the breaker</title>\n  <desc>After 5 counted failures a channel opens its breaker. Cooldown starts at 30 seconds, doubles on each failed probe, and caps at 300 seconds. When cooldown ends, one real call is let through. Success restores the channel.</desc>\n  <style>\n    text { font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }\n  </style>\n  <defs>\n    <marker id=\"arrow-green\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#22c55e\"/>\n    </marker>\n    <marker id=\"arrow-pink\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#ec4899\"/>\n    </marker>\n    <marker id=\"arrow-orange\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#f59e0b\"/>\n    </marker>\n  </defs>\n\n  <!-- 浅色画布：图被贴到深色页面上时，仍然读作一张白卡片 -->\n  <rect x=\"0\" y=\"0\" width=\"610\" height=\"302\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术在任何坐标落笔之前就定死了。\n       三个状态同宽同高：宽 170、高 54（两行：12 x 3 + 18），排成一行，\n       x = 22..192 / 220..390 / 418..588，行距 28px，顶边 120、底边 174，行心 y = 147。\n       为什么排成一行而不是摆成三角：块间距检查按「同一行」量水平净距，\n       一行里两个框拉开 286px 会被判「间距过松」，而 25–30px 是硬标准。\n       排成一行，两条回边就只能上下分走 —— 成功那条翻过顶部、失败那条兜在底部，\n       这是唯一能让两条都从「试水」出发、又不互相交叉的画法。\n       内容左右边界 22..588，宽 566，中心 305；viewBox 宽 = 566 + 两侧各 22 = 610。\n       标题与脚注都落在 305，与框体包围盒的中心同一个数。\n       高度 = 脚注末行基线 277 + 下伸 2.5 + 22px 边距 = 301.5，取整 302。 -->\n\n  <!-- 标题落在内容中心 305。y = 22 + 16 x 0.75 -->\n  <text x=\"305\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">How a channel comes back</text>\n\n  <!-- 第 1 层：连线。每条连线带着它离开的那个框的描边色。\n       两条短横线：起点 = 源框右沿 + 5，终点 = 目标框左沿 - 11，留 12px 可见线。\n       两条回边各是一条三次曲线，末段控制点与终点同 x，末端切线因此竖直，\n       箭头正对框顶（或框底）而不是斜着扎进去；起点离源框 5px、终点离目标框 11px。 -->\n  <path d=\"M197,147 L 209,147\" fill=\"none\" stroke=\"#22c55e\" stroke-width=\"1.5\" marker-end=\"url(#arrow-green)\"/>\n  <path d=\"M395,147 L 407,147\" fill=\"none\" stroke=\"#ec4899\" stroke-width=\"1.5\" marker-end=\"url(#arrow-pink)\"/>\n\n  <!-- 失败那条回边兜在底部：从「试水」底边 540 落下，横穿到 305 再抬起来进「熔断」底边。\n       最低点约在 (422, 210)，与它上方两个框的底边留 36px。 -->\n  <path d=\"M540,179 C 540,220 305,220 305,185\" fill=\"none\" stroke=\"#f59e0b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-orange)\"/>\n\n  <!-- 成功那条回边翻过顶部：从「试水」顶边 460 抬起，横穿到 107 再落进「正常」顶边。\n       最高点约在 (284, 82)，与下方三个框的顶边留 38px。 -->\n  <path d=\"M460,115 C 460,72 107,72 107,109\" fill=\"none\" stroke=\"#f59e0b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-orange)\"/>\n\n  <!-- 第 2 层：状态框和文字，盖住线头。\n       状态用 rx=18（普通组件框是 6），一行读下来才像「状态」而不是「零件」。\n       两行框的基线 = 框心 + 12 x 0.35 再上下各让 9px，于是 120 起的框落在 142 / 160。\n       绿是「渠道正常」那一组，也是读者默认的起点。 -->\n  <rect x=\"22\" y=\"120\" width=\"170\" height=\"54\" rx=\"18\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"107\" y=\"142\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">Healthy</text>\n  <text x=\"107\" y=\"160\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">Sending new traffic</text>\n\n  <!-- 粉是「警告 / 敏感」那一组：这是全图唯一「不发流量」的状态。 -->\n  <rect x=\"220\" y=\"120\" width=\"170\" height=\"54\" rx=\"18\" fill=\"#fce7f3\" stroke=\"#ec4899\"/>\n  <text x=\"305\" y=\"142\" font-size=\"12\" fill=\"#9d174d\" text-anchor=\"middle\">Cooling down</text>\n  <text x=\"305\" y=\"160\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">After 5 counted failures</text>\n\n  <!-- 橙是「处理中」那一组：试水是一次真实的探测调用，不是等待。 -->\n  <rect x=\"418\" y=\"120\" width=\"170\" height=\"54\" rx=\"18\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"503\" y=\"142\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">One probe</text>\n  <text x=\"503\" y=\"160\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Cooldown over, one call</text>\n\n  <!-- 两条回边的标注。成功那条压在曲线最高点之上 19.5px，\n       失败那条托在曲线最低点之下 16px —— 都按「曲线标注要留 15px 净空」给的余量。 -->\n  <text x=\"305\" y=\"60\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Fully restored</text>\n  <text x=\"422\" y=\"234\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Fail: doubles</text>\n\n  <!-- 脚注两行，同为 10px、行距 15px，与标题同一条中轴 305。\n       冷却的起值、倍数、封顶与「一个周期最多探一次」都只在原文的 NOTE 里，框内放不下。 -->\n  <text x=\"305\" y=\"262\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Cooldown starts at 30s, doubles on each failed probe, and caps at 300s.</text>\n  <text x=\"305\" y=\"277\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">The probe is a real call. One cooldown allows at most one probe.</text>\n</svg>\n","en-routing-multi-router":"<svg viewBox=\"0 0 492 346\" width=\"492\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>One account, more than one Router</title>\n  <desc>The default routes on the account are one Router. An account can have more. A key uses the Router it is bound to. An unbound key uses the default Router.</desc>\n  <style>\n    text { font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }\n  </style>\n  <defs>\n    <marker id=\"arrow-blue\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#3b82f6\"/>\n    </marker>\n    <marker id=\"arrow-orange\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#f59e0b\"/>\n    </marker>\n  </defs>\n\n  <!-- 浅色画布：图被贴到深色页面上时，仍然读作一张白卡片 -->\n  <rect x=\"0\" y=\"0\" width=\"492\" height=\"346\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术在任何坐标落笔之前就定死了。\n       三行，行距一律 28px，每行都是两行文字的高 54（12 x 3 + 18）。\n       第一行「账号」占满整行 22..470，宽 448：它是这两个 Router 的容器，\n       和 09-dataflow-tiered-routing 里那条横跨整行的网关条同一个意思 ——\n       容器横跨它所含的子框，两条竖线就能直落下去，不必绕弯。\n       第二行两个 Router：210 宽、间距 28，于是 22..232 / 260..470。\n       第三行两个 key 沿用第二行的 x，所以四条竖线全在 x = 127 与 x = 365 上，共轴。\n       行顶边 60 / 142 / 224，底边 114 / 196 / 278。\n       内容左右边界 22..470，宽 448，中心 246；viewBox 宽 = 448 + 两侧各 22 = 492。\n       标题与脚注都落在 246，与框体包围盒的中心同一个数。\n       高度 = 脚注末行基线 321 + 下伸 2.5 + 22px 边距 = 345.5，取整 346。 -->\n\n  <!-- 标题落在内容中心 246。y = 22 + 16 x 0.75 -->\n  <text x=\"246\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">One account, more than one Router</text>\n\n  <!-- 第 1 层：连线。竖向运行：起点 = 源框底边 + 5，终点 = 目标框顶边 - 11，\n       留 12px 可见线。四条全共轴（x = 127 与 x = 365），没有一条拐弯。\n       每条连线带着它离开的那个框的描边色。 -->\n  <path d=\"M127,119 L 127,131\" fill=\"none\" stroke=\"#3b82f6\" stroke-width=\"1.5\" marker-end=\"url(#arrow-blue)\"/>\n  <path d=\"M365,119 L 365,131\" fill=\"none\" stroke=\"#3b82f6\" stroke-width=\"1.5\" marker-end=\"url(#arrow-blue)\"/>\n  <path d=\"M127,201 L 127,213\" fill=\"none\" stroke=\"#f59e0b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-orange)\"/>\n  <path d=\"M365,201 L 365,213\" fill=\"none\" stroke=\"#f59e0b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-orange)\"/>\n\n  <!-- 第 2 层：方框和文字，盖住线头。\n       两行框的基线 = 框心 + 12 x 0.35 再上下各让 9px，于是 60 起的框落在 82 / 100，\n       142 起的落在 164 / 182，224 起的落在 246 / 264。\n       蓝是「输入」那一组：这是被路由的源头，也就是你的账号。 -->\n  <rect x=\"22\" y=\"60\" width=\"448\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"246\" y=\"82\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">Account</text>\n  <text x=\"246\" y=\"100\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">What you edit on Routing is the account's one default route set</text>\n\n  <!-- 橙是「处理中」那一组：Router 干的就是「按优先级挑渠道」这件事。\n       两个 Router 同色 —— 它们语义上是同一种东西，差别只在「默认」还是「命名」；\n       给两种颜色反而会暗示两种不同的角色。 -->\n  <rect x=\"22\" y=\"142\" width=\"210\" height=\"54\" rx=\"6\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"127\" y=\"164\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">Default Router</text>\n  <text x=\"127\" y=\"182\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">The account's one default set</text>\n\n  <rect x=\"260\" y=\"142\" width=\"210\" height=\"54\" rx=\"6\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"365\" y=\"164\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">Named Router</text>\n  <text x=\"365\" y=\"182\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Several, each with its own routes</text>\n\n  <!-- 绿是「渠道 / 落点」那一组：key 是真正被分派下去的东西，\n       两个 key 同色，同样因为它们是同一种东西。 -->\n  <rect x=\"22\" y=\"224\" width=\"210\" height=\"54\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"127\" y=\"246\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">Keys with no binding</text>\n  <text x=\"127\" y=\"264\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">They land here</text>\n\n  <rect x=\"260\" y=\"224\" width=\"210\" height=\"54\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"365\" y=\"246\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">Keys bound to it</text>\n  <text x=\"365\" y=\"264\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">They use its route set</text>\n\n  <!-- 脚注两行，同为 10px、行距 15px，与标题同一条中轴 246。\n       绑定用的那个接口名只在原文正文里出现一次，框内放不下，落在脚注上。 -->\n  <text x=\"246\" y=\"306\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Bind a key to a Router: POST /v1/api-keys/bind-router</text>\n  <text x=\"246\" y=\"321\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Test keys can use cheap models. Production keys stay on vendors you trust.</text>\n</svg>\n"}}