{"article":{"title":"Errors","breadcrumb":["Operations","Errors"],"body":"**What this solves**: When a call fails, how to locate the cause in a fixed order; and how to explain a failure to an end user without misleading them.\n\nWhen a call fails, locate the cause in the order below. When you need to relay the cause to an end user, use the same set of judgments.\n\n**What you need to know first**: The error body has the OpenAI shape (`{\"error\": {\"message\": …, \"type\": …}}`), and that is the shape SDKs read. With any other shape, your client logs degrade to an `undefined` line.\n\n### Triage order: status code first, then code / type, then refusal_reason\n\nDon't look at the HTTP status code alone. The same `403` can come from key type, quota, source IP, DLP, budget, and other reasons, so you have to look two levels deeper.\n\n| Order | Which cell to look at | What it answers |\n|---|---|---|\n| 1 | HTTP status code | Which broad category the failure belongs to (credential / permission / not found / rate limit / upstream / platform) |\n| 2 | `error.code` / `error.type` | `code` is **always identical** to the status code, so branching on it is safe; `type` (same value as `metadata.error_type`) **is always present**, and it separates the different reasons behind the same status code, such as the two kinds of 503 |\n| 3 | `metadata.refusal_reason` | Within \"refusal-class\" errors, pin down exactly which kind of refusal it is (quota, budget, arrears, IP) |\n\n![A failed call: locate the cause in a fixed order](diagram:en-errors-triage-flow)\n\nIf you finish these three steps and still aren't sure, then check [Call Traces](content-retention), the [audit log](audit-trail), and Model Health (see [Routing](routing)).\n\n#### What to judge first by status code\n\n| Status | What to judge first |\n|---|---|\n| 400 | Request shape, DLP, whether the `provider` filter emptied out the candidates |\n| 401 | Whether the key exists, is expired, or is disabled |\n| 402 | Whether the account balance is insufficient |\n| 403 | Key type, quota, budget, source IP, DLP |\n| 404 | Whether the model route exists, or whether the generation has not been written yet |\n| 429 | Rate limit; handle it per `Retry-After` |\n| 503 | Whether all upstream candidates are unavailable |\n\n### Status code meanings and handling\n\n| Status code | Meaning | How to handle |\n|---|---|---|\n| **401** | Key missing, malformed, or revoked | Check the header. 401 is only about the credential itself |\n| **403** | The credential is valid, but this call isn't allowed through | Key type doesn't match the endpoint, quota is used up, or the source IP isn't on this key's allowlist; check `metadata.refusal_reason` |\n| **404** | **No route is configured for this model** | Change the model name, add a route, or add a catch-all |\n| **402** | **Account arrears** (the only meaning) | Top up; recovery is automatic |\n| **429** | Requests per minute exceeded | Back off per `Retry-After`, see [Rate limits and quotas](limits) |\n| **502** | Tare couldn't get a usable response from the upstream provider (including problems with Tare's own credential at that provider, which aren't your concern) | Retry; if it keeps happening, look into this channel |\n| **503** | **The same status code has two different causes behind it, and the status code alone can't tell them apart — look at `error.type`.** `provider_overloaded`: the route is configured, but all its channels are currently failing. `provider_unavailable`: Tare's billing service is currently unreachable, unrelated to the model | Retry with backoff for both; the first is a route-configuration problem, the second is unrelated to your model and routes |\n| **504** | The upstream didn't respond within the timeout | Retry; a consistently slow channel should have its timeout shortened or a backup route added |\n| **500** | A service failure on Tare's side | Retry; include the request ID when you contact support |\n\n### Distinguishing the three kinds of \"insufficient balance\"\n\n> [!WARNING]\n> **An exhausted quota returns 403; don't confuse it with 402.** 402 only means account arrears. The division of labor between the two codes is about \"whose problem this is\": 402 is money the account owes the platform, while 403 is stopped by a governance threshold (key quota, monthly budget).\n\nThe table below is **the only authoritative statement**:\n\n| Case | HTTP | `error.type` / `metadata.error_type` | `metadata.refusal_reason` |\n|---|---|---|---|\n| This key's cumulative quota is used up | **403** | `token_limit_exceeded` | `key_credit_exhausted` |\n| The account's monthly budget is maxed out | **403** | `token_limit_exceeded` | `budget_exhausted` |\n| Account arrears | **402** | `payment_required` | `account_balance_insufficient` |\n| The call source isn't on this key's IP allowlist | **403** | `permission_denied` | `source_ip_not_allowed` |\n\n#### What to say when relaying to an end user\n\nWhen a platform-type customer needs to relay the cause to an end user, look at **`refusal_reason`**; don't read the copy verbatim:\n\n| `refusal_reason` | Meaning | What to tell the end user |\n|---|---|---|\n| `key_credit_exhausted` | This key's cumulative quota is used up | \"Your quota is used up\"; topping up fixes it |\n| `budget_exhausted` | The account's monthly budget is maxed out | **Not their concern**; don't steer them to top up |\n| `account_balance_insufficient` | Account arrears | **Not their concern**; don't steer them to top up |\n| `source_ip_not_allowed` | The source address isn't on this key's list | **Nothing to do with money**: retry from a machine that is on the list, or ask the key's holder to add this machine to the list |\n\nIf you describe the middle two as \"your quota is used up\", the user will pay for something that isn't their concern; if you describe the last one as a quota problem, they'll go top up an account that isn't short of money at all.\n\n![How to tell the three kinds of \"insufficient balance\" apart](diagram:en-errors-balance-decision)\n\n```json\n{\"error\":{\"code\":403,\"type\":\"token_limit_exceeded\",\"message\":\"...\",\"metadata\":{\n  \"error_type\":\"token_limit_exceeded\",\n  \"refusal_reason\":\"key_credit_exhausted\"}}}\n```\n\n### The two response envelopes\n\nDifferent endpoints return different envelopes, so when you integrate, first recognize which kind you're hitting:\n\n| Endpoint | Success | Failure |\n|---|---|---|\n| `/v1/chat/completions`, `/v1/embeddings`, `/v1/images`, `/v1/videos/generations*`, `/v1/keys/*`, `/v1/models`, `/v1/generation` | OpenAI shape | **HTTP non-2xx** + `{\"error\":{…}}` |\n| `/v1/integration/*`, `/v1/content-settings*`, `/v1/alerts/*`, `/v1/mocks/*` | `{\"code\",\"message\",\"data\",\"success\"}` | **HTTP non-2xx, and the body is still this envelope** (not 200 + `success:false`) |\n\n> [!WARNING]\n> When you reach the reconciliation endpoints through the `api.jamerly.dev` gateway, the gateway **doesn't unwrap the upstream envelope**, so the business data is nested two levels deep (`data.data`); a direct connection to `tare.jamerly.ai` has only one level. **The test is whether a `code`/`success` is nested inside `data` again**, regardless of deployment location. This holds under both deployments.\n\n### The shape of the error body\n\n```json\n{\"error\":{\n  \"code\": 403,\n  \"type\": \"token_limit_exceeded\",\n  \"message\": \"...\",\n  \"metadata\": {\n    \"error_type\": \"token_limit_exceeded\",\n    \"refusal_reason\": \"key_credit_exhausted\",\n    \"provider_code\": \"503\",\n    \"provider_raw\": \"{\\\"error\\\":{\\\"code\\\":\\\"model_not_found\\\",\\\"message\\\":\\\"...\\\"}}\"\n  }}}\n```\n\n| Field | Guarantee |\n|---|---|\n| `error.code` | **Always equals the HTTP status code**; branching on it is safe |\n| `error.type` | **Always present**; the OpenAI SDK reads this cell |\n| `metadata.error_type` | **Same value** as `error.type`; some SDKs read only this cell |\n| `metadata.refusal_reason` | Present only for the three kinds of refusal above |\n| `metadata.provider_code` | The upstream's raw status code, forwarded as-is, may be missing |\n| `metadata.provider_raw` | Not guaranteed. On a BYOK channel (your own provider key) it may carry the upstream's raw response; on platform and Token Market channels it is not included |\n\n> [!NOTE]\n> `error.message` is generated by Tare: it states which class of failure this is.\n> When the failure stems from **this request itself** (a malformed tool schema, an out-of-range parameter), `message` is the upstream's one-line explanation, taken from `error.message` in the upstream's error body; the body's other fields are not returned.\n\n> [!NOTE]\n> The top-level `type` and `metadata.error_type` are **the same value, deliberately duplicated**: the two ecosystems don't read the same cell.\n> If you only provide the latter, a client written against the OpenAI SDK gets undefined, without an error — it just displays a clear refusal as an \"unknown error\".\n>\n> The values of `error_type` stay unchanged; the finer breakdown is **added** on `refusal_reason`.\n\n### Distinguishing 404 from 503\n\n\"No route configured\" is fixed by changing the config; \"all upstreams failed\" is fixed by waiting. Merging them into one status code would point people in the wrong direction, which is why the catch-all route only covers the 404 side and not the 503 side.\n\n> [!NOTE]\n> Here we use 404 rather than 402: 402 means \"you can continue after paying\", whereas this error won't get better no matter how much you pay. Otherwise you'd top up first, then check the balance, and only at the end find out the model name was misspelled.\n\n**There's another easy-to-confuse pair of 404 and 503, on endpoints like embeddings** (for details see the [Endpoint list](endpoints)):\n\n- **503**: All candidate channels are in the circuit-breaker state. It means \"not right now\", and the fix is to wait a bit and retry. This is recorded as an incident of type `UPSTREAM_ALL_DOWN`, visible on the model's health timeline.\n- **404**: This model has **no pricing** on platform channels. It means \"a configuration problem\", and the fix is to switch to your own channel, or contact us to price this model. On platform channels, tokens are bought from upstream by the platform, and when the price list is missing this row the pricing computes to 0. Better to fail clearly than to serve silently for free.\n\nBoth are reported the same way as other endpoints: `UPSTREAM_ALL_DOWN` is a distinct incident type.\n\n> [!NOTE]\n> `model_not_found` is an **upstream** error code, meaning the upstream doesn't have this model. It's not the same thing as the 404 for \"Tare has no route configured for this model\".\n\n#### Has a route but the modality doesn't match\n\nReturns 404, but with a different message: the configured upstream doesn't accept images (or audio, or video). The fix is to tick that input in the model's **Capabilities** on the Routing page, or switch to a model that supports that input.\n\n### A successful call with no text\n\nIf a reasoning model returns no text, the output limit (`max_tokens`) was likely used up by reasoning before it started answering. Raise `max_tokens`.\n\n![404 vs 503: same code, different cause](diagram:en-errors-404-503)\n\n### Next steps\n\n- To test one error branch over and over: read [Drills (Mock)](mock).\n- To understand how the \"source IP allowlist\" in 403 is configured: read [API Key](auth).\n- To understand how to tune the rate-limit tier: read [Rate limits and quotas](limits).\n"},"diagrams":{"en-errors-triage-flow":"<svg viewBox=\"0 0 700 210\" width=\"700\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>A failed call: find the cause in order</title>\n  <desc>Do not stop at the HTTP status. Read the status, then error.code and error.type, then metadata.refusal_reason. If that is still unclear, check Call Traces, the audit log, and Model 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-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=\"700\" height=\"210\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术在任何坐标落笔之前就定死了。\n       三步排成一行：宽 200、间距 28，于是 22..222 / 250..450 / 478..678。\n       必须排成一行：块间距检查按「竖直方向有重叠」判定同行，同行就量水平净距、\n       必须 25–30px；而这三步本来就是一条定序，摆成别的形状反而读不出先后。\n       框高三行 = 12 x 3 + 2 x 18 = 72，顶边 60、底边 132，行心 y = 96。\n       200 的框宽给最宽的一行字留了左右各 30px 内边距。\n       内容左右边界 22..678，中心 350；viewBox 宽 = 656 + 两侧各 22 = 700；\n       标题与两条脚注都落在 350，和框体包围盒的中心是同一个数。\n       高度 = 脚注末行基线 185 + 下伸 2.5 + 22px 边距 = 209.5，取整 210。 -->\n\n  <!-- 标题落在内容中心 350。y = 22 + 16 x 0.75 -->\n  <text x=\"350\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">A failed call: find the cause in order</text>\n\n  <!-- 第 1 层：两条短横线，起点 = 源框右沿 + 5，终点 = 目标框左沿 - 11，留 12px 可见线。\n       都在行心 96 上，与三个框同轴。 -->\n  <path d=\"M227,96 L 239,96\" fill=\"none\" stroke=\"#3b82f6\" stroke-width=\"1.5\" marker-end=\"url(#arrow-blue)\"/>\n  <path d=\"M455,96 L 467,96\" fill=\"none\" stroke=\"#f59e0b\" stroke-width=\"1.5\" marker-end=\"url(#arrow-orange)\"/>\n\n  <!-- 第 2 层：方框和文字，盖住线头。\n       三行框的基线 = 框心 + 12 x 0.35 再按 -13 / +5 / +20 摊开，落在 83 / 101 / 116。\n       三种颜色对应三种性质，不是同一件事的三次重复：\n       蓝是「输入」——先定大类；橙是「处理中」——再细分；绿是「输出」——落到具体拒绝原因。 -->\n  <rect x=\"22\" y=\"60\" width=\"200\" height=\"72\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"122\" y=\"83\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">1. Read the HTTP status</text>\n  <text x=\"122\" y=\"101\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">Which class of failure</text>\n  <text x=\"122\" y=\"116\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">Auth, missing, limit, upstream</text>\n\n  <rect x=\"250\" y=\"60\" width=\"200\" height=\"72\" rx=\"6\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"350\" y=\"83\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">2. Read code and type</text>\n  <text x=\"350\" y=\"101\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">code matches the status</text>\n  <text x=\"350\" y=\"116\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Same code: read type</text>\n\n  <rect x=\"478\" y=\"60\" width=\"200\" height=\"72\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"578\" y=\"83\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">3. Read refusal_reason</text>\n  <text x=\"578\" y=\"101\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">Only on a refusal</text>\n  <text x=\"578\" y=\"116\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">Quota, budget, arrears, IP</text>\n\n  <!-- 脚注两行，同为 10px、行距 15px，与标题同一条中轴 350。\n       第一条是「不要只看 HTTP 状态码」那句 WARNING 的落点，并补上 503 必须看 error.type；\n       第二条是三步之后的去处，原文第 22 行。 -->\n  <text x=\"350\" y=\"170\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">One 403 can be key type, quota, source IP, DLP, or budget. One 503 has two causes. Split them with error.type.</text>\n  <text x=\"350\" y=\"185\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">If the three steps are still unclear, check Call Traces, the audit log, and Model Health.</text>\n</svg>\n","en-errors-balance-decision":"<svg viewBox=\"0 0 812 280\" width=\"812\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>Three kinds of not enough balance</title>\n  <desc>402 means the account owes the platform, and a top-up restores it. 403 means the credential is valid but refused: quota, monthly budget, or source IP. Tell the end user from refusal_reason.</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  </defs>\n\n  <!-- 浅色画布：图被贴到深色页面上时，仍然读作一张白卡片 -->\n  <rect x=\"0\" y=\"0\" width=\"812\" height=\"276\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术在任何坐标落笔之前就定死了。\n       根框横跨整行 22..790（宽 768），两列并排在这一行之下：宽 370、间距 28，\n       于是 22..392 / 420..790。\n       为什么根框横跨、两列各自撑到半幅：块间距检查按「同一行」量水平净距，必须 25–30px；\n       两列之间留 28px 是硬标准，所以两列只能各自占半幅、从 22 顶到 790。\n       框高按公式给：根框两行 54，两列三行 72。行顶边 60 / 142。\n       内容左右边界 22..790，中心 406；viewBox 宽 = 768 + 两侧各 22 = 812；\n       标题与脚注都落在 406，和框体包围盒的中心是同一个数。\n       高度 = 脚注末行基线 255 + 下伸 2.5 + 22px 边距 = 279.5，取整 280。\n\n       注：原文把这张叫「决策树」，但这里两条并列的 HTTP 码（402 / 403）是分叉，\n       不是先后步骤；摆成左 402、右 403 的双栏，比硬画成一条链更不误导。 -->\n\n  <!-- 标题落在内容中心 406。y = 22 + 16 x 0.75 -->\n  <text x=\"406\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">Three kinds of not enough balance</text>\n\n  <!-- 第 1 层：两条竖向连线，从根框底边落到两列顶边。\n       根框横跨整行，所以两条线都是纯竖直、落在两列各自的中心 207 / 605。 -->\n  <path d=\"M207,119 L 207,131\" fill=\"none\" stroke=\"#3b82f6\" stroke-width=\"1.5\" marker-end=\"url(#arrow-blue)\"/>\n  <path d=\"M605,119 L 605,131\" fill=\"none\" stroke=\"#3b82f6\" stroke-width=\"1.5\" marker-end=\"url(#arrow-blue)\"/>\n\n  <!-- 第 2 层：根框和两列，盖住线头。\n       根框两行基线 82 / 100（框心 87 + 12 x 0.35，再上下各让 9px）；\n       两列三行基线 165 / 183 / 198（框心 178，按 -13 / +5 / +20 摊开）。\n       蓝是「输入」那一组：问题本身。绿是「已经能解决」那一类（欠费可充值）；\n       橙是「要细分」那一类（403 按 refusal_reason 拆）。 -->\n  <rect x=\"22\" y=\"60\" width=\"768\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"406\" y=\"82\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">Balance, quota, or permission error</text>\n  <text x=\"406\" y=\"100\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">HTTP first: 402 is arrears, 403 needs refusal_reason</text>\n\n  <rect x=\"22\" y=\"142\" width=\"370\" height=\"72\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"207\" y=\"165\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">402 · account arrears</text>\n  <text x=\"207\" y=\"183\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">Only this: the account owes the platform</text>\n  <text x=\"207\" y=\"198\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">Top up. Recovery is automatic.</text>\n\n  <rect x=\"420\" y=\"142\" width=\"370\" height=\"72\" rx=\"6\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"605\" y=\"165\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">403 · valid credential, still refused</text>\n  <text x=\"605\" y=\"183\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Quota, monthly budget, or source IP</text>\n  <text x=\"605\" y=\"198\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Read refusal_reason: quota, budget, IP</text>\n\n  <!-- 脚注两行，同为 10px、行距 15px，与标题同一条中轴 406。\n       这是原文「转述给终端用户」那段的落点，也是这张图最容易踩的坑：\n       中间两种说成「你的额度用完了」，用户会为与自己无关的事付费。\n       根框横跨整行（到 790），脚注虽然比根框窄，但 bbox 仍由根框撑着，左右各留 22px。 -->\n  <text x=\"406\" y=\"240\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Tell the end user from refusal_reason, not by reading the message text.</text>\n  <text x=\"406\" y=\"255\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">key_credit_exhausted: offer a top-up. Budget and arrears are not the user's. source_ip_not_allowed is not money.</text>\n</svg>\n","en-errors-404-503":"<svg viewBox=\"0 0 812 286\" width=\"812\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>404 and 503: same code, different cause</title>\n  <desc>404 and 503 each have more than one cause. 404 is configuration: no route, a modality mismatch, or an unpriced platform channel. 503 is temporary: every channel failed, the billing service is down, or embeddings candidates are all open.</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  </defs>\n\n  <!-- 浅色画布：图被贴到深色页面上时，仍然读作一张白卡片 -->\n  <rect x=\"0\" y=\"0\" width=\"812\" height=\"286\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术在任何坐标落笔之前就定死了。\n       根框横跨整行 22..790（宽 768），两栏并排在这一行之下：宽 370、间距 28，\n       于是 22..392 / 420..790。\n       为什么根框横跨、两栏各自撑到半幅：和图 2 同一个理由——\n       两栏之间只能留 28px，所以各自占半幅、从 22 顶到 790。\n       框高按公式给：根框两行 54，两栏四行 = 12 x 3 + 3 x 18 = 90。行顶边 60 / 142。\n       内容左右边界 22..790，中心 406；viewBox 宽 = 768 + 两侧各 22 = 812；\n       标题与脚注都落在 406，和框体包围盒的中心是同一个数。\n       高度 = 脚注基线 262 + 下伸 2.5 + 22px 边距 = 284.5，取整 286。\n\n       注：原文把这张叫「决策树」，但核心是「同一个码两种相反解法」的对照，\n       左 404（改配置）、右 503（退避）双栏，比硬画一条分叉链更不误导。 -->\n\n  <!-- 标题落在内容中心 406。y = 22 + 16 x 0.75 -->\n  <text x=\"406\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">404 and 503: same code, different cause</text>\n\n  <!-- 第 1 层：两条竖向连线，从根框底边落到两栏顶边，纯竖直，落在 207 / 605。 -->\n  <path d=\"M207,119 L 207,131\" fill=\"none\" stroke=\"#3b82f6\" stroke-width=\"1.5\" marker-end=\"url(#arrow-blue)\"/>\n  <path d=\"M605,119 L 605,131\" fill=\"none\" stroke=\"#3b82f6\" stroke-width=\"1.5\" marker-end=\"url(#arrow-blue)\"/>\n\n  <!-- 第 2 层：根框和两栏，盖住线头。\n       根框两行基线 82 / 100；两栏四行基线 165 / 183 / 198 / 213\n       （框心 187，12px 标题落在 165，三条 10px 行按 15px 行距落到 183 / 198 / 213）。\n       蓝是「输入」那一组：问题。橙是「配置问题」那一类（改了就好）；\n       粉是「暂时不行」那一类（等一等）。两种颜色，因为解法完全相反。 -->\n  <rect x=\"22\" y=\"60\" width=\"768\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"406\" y=\"82\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">You got a 404 or a 503</text>\n  <text x=\"406\" y=\"100\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">The status is not enough. Read error.type and context.</text>\n\n  <rect x=\"22\" y=\"142\" width=\"370\" height=\"90\" rx=\"6\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"207\" y=\"167\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">404 · config. A change fixes it.</text>\n  <text x=\"207\" y=\"185\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">No route: fix the name, add one, or catch-all</text>\n  <text x=\"207\" y=\"200\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Modality mismatch: declare it on the route</text>\n  <text x=\"207\" y=\"215\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Platform channel unpriced: use your own</text>\n\n  <rect x=\"420\" y=\"142\" width=\"370\" height=\"90\" rx=\"6\" fill=\"#fce7f3\" stroke=\"#ec4899\"/>\n  <text x=\"605\" y=\"167\" font-size=\"12\" fill=\"#9d174d\" text-anchor=\"middle\">503 · temporary. Wait.</text>\n  <text x=\"605\" y=\"185\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">provider_overloaded: every channel failed</text>\n  <text x=\"605\" y=\"200\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">provider_unavailable: billing is down</text>\n  <text x=\"605\" y=\"215\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">embeddings all open: back off and retry</text>\n\n  <!-- 脚注一行，10px，与标题同一条中轴 406。\n       这是原文那句「合并成一个状态码会把人引向错误方向」的落点，也是兜底只补 404 一侧的原因。 -->\n  <text x=\"406\" y=\"262\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Catch-all covers only a model with no route. It does not fix modality or price. For 503, find the cause and back off.</text>\n</svg>\n"}}