{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"这篇解决什么问题"}]},{"type":"text","value":"：让某个对外模型名由你指定的渠道作答，并配好主备顺序、分流比例和故障转移。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"路由决定某个模型名由哪个渠道作答。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"调用方只知道："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-json"]},"children":[{"type":"text","value":"{\n  \"model\": \"GLM 5.1\",\n  \"messages\": [...]\n}\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Routing 决定的是："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"GLM 5.1\n  ↓\nopenrouter-prod / z-ai/glm-5.1\n  ↓\n如果失败，再走备用渠道\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"添加渠道只是把上游账号接进来。要让真实流量走这条渠道，必须在 Routing 页创建路由。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"控制台入口："},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Routing"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"一条路由包含什么"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"新增路由时，要填这些字段："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"字段"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"含义"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Model"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"调用方请求 Tare 时使用的模型名"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Upstream name"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"上游实际认识的模型名"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Channel"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"这条路由要走的渠道"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Tier / Priority"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"主用还是备用"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Weight"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"同一层级内的流量比例"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Enabled"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是否启用"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"示例："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"Model = GLM 5.1\nChannel = openrouter-prod\nUpstream name = z-ai/glm-5.1\nTier = Primary\nWeight = 1\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"含义是：调用方请求 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GLM 5.1"}]},{"type":"text","value":" 时，Tare 发给 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"openrouter-prod"}]},{"type":"text","value":"，并把上游模型名改成 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"z-ai/glm-5.1"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Model 和 Upstream name 的区别"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这是路由最容易混的地方。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"名称"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"谁看到"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"例子"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Model"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"你的业务、你的下游用户、Tare API"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GLM 5.1"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Upstream name"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"上游供应商"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"z-ai/glm-5.1"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"如果两边名字一样，Upstream name 可以留空，表示使用同名。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"如果上游是聚合网关，通常建议明确选择或填写上游模型名，避免模型名拼错后直到调用时才暴露。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"配一条最简单的路由"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"前提：已经在 Channels 页添加并测试通过一条渠道。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"打开 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Routing"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"点 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Add route"}]},{"type":"text","value":"，填写 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Model"}]},{"type":"text","value":"，例如 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GLM 5.1"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"选择 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Channel"}]},{"type":"text","value":"，例如 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"openrouter-prod"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"在 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Upstream name"}]},{"type":"text","value":" 里选择或填写上游模型，例如 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"z-ai/glm-5.1"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Tier"}]},{"type":"text","value":" 选 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Primary"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Weight"}]},{"type":"text","value":" 保持 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"1"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"点击 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Add"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"用业务 key 发一次真实请求验证。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"覆盖平台默认模型"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"如果你创建的 Model 名和平台默认模型同名，你自己的路由会优先接管。平台那条不会消失，它会留在后面作为兜底：你的供应商故障时，这个模型不会跟着不可用。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"例子："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"平台已有：GPT-5.6 Sol\n你新增：GPT-5.6 Sol -> openrouter-prod / openai/gpt-5.6\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"之后调用 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GPT-5.6 Sol"}]},{"type":"text","value":" 时，会先走你的渠道。你的渠道失败时，平台默认模型仍可能兜底，具体取决于该 Router 的平台模型开关。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"平台默认模型背后接的是哪个上游，由平台管理，可能不经通知就调整。需要自己控制时，用同名模型加一条自己的路由。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"路由到 Tare 的模型"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Channel"}]},{"type":"text","value":" 下拉里选 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Tare"}]},{"type":"text","value":"，路由就指向一个平台默认模型，目标模型从平台模型里选。不需要先有自己的渠道。可以用来："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"把 Tare 的模型和自己的渠道放在同一档按权重分流，或者设成主用、备用；"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"给 Tare 的模型起自己的名字。例如调用 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"fast"}]},{"type":"text","value":" 实际走 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"qwen/qwen3.7-flash"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"计费按目标模型的 Tare 售价，起了别名也一样。用量记录上显示的是你调用时用的名字。这一行的权重算的是 Tare 整体。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Priority / Tier"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Priority 是主备顺序，数值小的先走。控制台里用更容易理解的 Tier 展示："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Tier"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"含义"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Primary"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"主用层，优先尝试"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Fallback 1"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"第一层备用"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Fallback 2"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"第二层备用"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"同一个模型可以有多条路由："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"img","properties":{"src":"diagram:routing-priority-tier","alt":"路由的主备层级","data-block":"true"},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"只有当前层级都不可用时，才进入下一层。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"新加一条路由如果选择「New fallback」，或者没指定 priority，会落进现有最高档之后新开的一档，从来不是 0，不会悄悄抢走主用流量。加第四条备用，永远不会静默抢走前三条正在跑的流量。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Weight"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Weight 只在同一 Tier 内生效，用来拆分流量。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"例子："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"Primary:\n  openrouter-a weight = 9\n  openrouter-b weight = 1\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"大致表示 10 个会话里 9 个走 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"openrouter-a"}]},{"type":"text","value":"，1 个走 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"openrouter-b"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"分流按会话分，不按单次调用分：同一个会话（同一次对话）一直走同一条渠道，上游和订阅那边的缓存更容易命中；那条渠道失败、熔断或者卖完时才换到同档的另一条。会话按请求头 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"X-Claude-Code-Session-Id"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Session-Id"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"X-Session-Id"}]},{"type":"text","value":"，或者请求体里的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"prompt_cache_key"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"metadata.user_id"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"user"}]},{"type":"text","value":" 识别，Claude Code 和 Codex 自带这些字段。都没有时按 API key：同一把 key 的调用走同一条渠道。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"img","properties":{"src":"diagram:routing-weight","alt":"同一层内按权重分流","data-block":"true"},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"注意："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"9 和 1 与 90 和 10 是同一个比例。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"前提是两条渠道一样快。一条渠道比同模型下最快的那条明显慢时，配置的权重会被按比例调低（见下文「自动降权慢渠道」），所以实际观察到的分流会比你配的更松，即使两条渠道都算不上不健康。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Weight 最小值是 1。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Weight = 0 不表示暂停。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"要暂停一条路由，应关闭 Enabled，而不是把 Weight 改成 0。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"智能编排"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Routing 页支持对某个模型一键重排（打开这个模型，点 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Fastest first"}]},{"type":"text","value":" 或 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Cheapest first"}]},{"type":"text","value":"）："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"按实测延迟排。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"按供应商进价排。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"它只在点的时候跑一次，不会常驻。之后新增路由不会自动跟着重排，需要你再点一次。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"默认 Router 使用："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"POST /v1/routing/routes/arrange\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"命名 Router 使用："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"POST /v1/routers/{id}/routes/arrange\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"路由测试"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"一条路由可以单独测试：打开这个模型，在路由的 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"⋯"}]},{"type":"text","value":" 菜单里选 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Test"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"测试内容比渠道测试多一项：不仅要检查地址、凭据、Dialect（各家 API 的差异），还要检查这条路由指向的上游模型名是否存在。前三项和"},{"type":"element","tagName":"a","properties":{"href":"channels"},"children":[{"type":"text","value":"测试一个渠道"}]},{"type":"text","value":"一样是三道检查，最后一项是路由独有的。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"相关操作："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"操作"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"默认 Router"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"命名 Router"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"测试路由"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routing/routes/{routeId}/test"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routers/{id}/routes/{routeId}/test"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"用路由发一句话"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routing/routes/{routeId}/chat"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"对应 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1/routers/{id}/..."}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这两个诊断调用不计入 Tare 账单，也不进入 Call Traces。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"参数处理（Parameter rules）"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"同一个模型换一家上游，接受的参数可能不一样：有的不认 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"temperature"}]},{"type":"text","value":"，有的不支持 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"thinking.type"}]},{"type":"text","value":" 的某个取值，有的要求 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"output_config.effort"}]},{"type":"text","value":" 必须是固定值。这些按「渠道 + 上游模型」单独设置：Routing 页上打开这个模型，在你自己渠道那条路由的 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"⋯"}]},{"type":"text","value":" 菜单里选 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Parameter rules"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"常用参数按这条渠道的接口格式列出来，每个三选一："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"选项"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"效果"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"As sent"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"客户端发什么就转什么（默认）"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Don't send"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"不转给这条上游"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Fixed"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"固定成你填的值；客户端没传也会加上"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"参数"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"固定值"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"对应的上游字段"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"temperature"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"0–2"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"temperature"}]},{"type":"text","value":"（Gemini 是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"generationConfig.temperature"}]},{"type":"text","value":"）"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"thinking.type"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"enabled"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"disabled"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"adaptive"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"thinking.type"}]},{"type":"text","value":"；选 Don't send 时整个 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"thinking"}]},{"type":"text","value":" 都不转"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"effort"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"minimal"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"low"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"medium"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"high"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"xhigh"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"max"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Anthropic "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"output_config.effort"}]},{"type":"text","value":"、OpenAI "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"reasoning_effort"}]},{"type":"text","value":"、Responses "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"reasoning.effort"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cache_control"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"只能选 Don't send"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"system、tools、messages 里所有的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cache_control"}]},{"type":"text","value":"；Tare 也不再为这条路由自动加缓存断点"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"列表之外的参数点 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"+ Field"}]},{"type":"text","value":"，填字段路径（如 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"top_k"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"extra_body.enable_search"}]},{"type":"text","value":"），选不传、固定值，或「Remove everywhere」（在 system、tools、messages 里任意层级删掉这个键）。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"改写在发给这家上游的请求上按它的接口格式执行，只动你设置的字段，消息内容不变；除非设置了 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cache_control"}]},{"type":"text","value":"，缓存断点也不变。同一个参数 Tare 自己也可能有默认处理，你的设置优先。改完一分钟内生效；实际改了什么记在 Call Traces 这次调用的参数改写里。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"接口格式是 Anthropic 的渠道，Tare 可以在请求里没打缓存断点的地方补上：最后一个工具、system 末尾、最后一条消息，总共不超过 4 个。默认不补；某条渠道要补，编辑渠道，勾选 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Add prompt cache breakpoints automatically"}]},{"type":"text","value":"。你自己打的断点不管开没开都原样保留。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"接口："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/param-rules"}]},{"type":"text","value":" 列出你设置过的全部规则；"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"PUT /v1/param-rules"}]},{"type":"text","value":" 按「渠道 + 上游模型」整组替换（空数组 = 清掉）："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-json"]},"children":[{"type":"text","value":"{\"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"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"action"}]},{"type":"text","value":" 是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"DROP"}]},{"type":"text","value":"（不传）、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"SET"}]},{"type":"text","value":"（固定值）、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"CALIBRATE"}]},{"type":"text","value":"（客户端传了才改成这个值）或 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"STRIP"}]},{"type":"text","value":"；字段按渠道的接口格式写。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"故障转移"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"失败的调用几乎总会转移到下一个候选。唯一明确的例外是：你自己的客户端在请求进行到一半断开连接。这种情况直接停止转移，继续下去只是在生成一个没人会看的答案。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"发生了什么"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"会转移到下一条渠道"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"算这条渠道健康度"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"客户端断开连接"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"否"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"否"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"请求格式错误 400 / 413 / 422"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"否"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"凭据被拒 401 / 403"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"上游没有模型 404"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"上游限流 429"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"上游 5xx 或超时"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"是"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"下图适用于首字节返回前的候选尝试。流式内容开始返回后不再转移；中断后的计费见"},{"type":"element","tagName":"a","properties":{"href":"billing"},"children":[{"type":"text","value":"计费规则"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"img","properties":{"src":"diagram:routing-failover","alt":"失败之后会不会转移到下一条渠道","data-block":"true"},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"note"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"格式错误的请求仍然会转移。有的中转型供应商会把自己上游的故障也报成一个普通的 400，只按状态码判断「不转移」，会让一条完全健康的第二渠道被晾在一边，你的调用却直接失败了。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"但它不会算进这条渠道的健康度：一批因为客户端自己发版发坏了的请求，不该足以把一条从没真正出过问题的渠道打进停靠状态。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"一次调用会尝试的候选数量没有上限。配了四条备用就是四次尝试；多等那几百毫秒值不值，是你加第四条路由时自己的取舍。存在一个应急上限，只对极少数候选配置异常的账号开启，默认关闭；命中它之后怎么计费见"},{"type":"element","tagName":"a","properties":{"href":"billing"},"children":[{"type":"text","value":"计费规则"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"每一次尝试都能在 "},{"type":"element","tagName":"a","properties":{"href":"content-retention"},"children":[{"type":"text","value":"Call Traces"}]},{"type":"text","value":" 里看到：成功、被拦、失败，或者压根没被尝试过（只有账号上那条应急上限生效时才会出现）。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"熔断"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"一条渠道累计 5 次算数的失败后会熔断："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"先冷却 30 秒，这期间不再发新流量。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"冷却到期时，只放行一次真实请求试水。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"成功则完全恢复。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"失败则冷却时间翻倍，重新等待。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"冷却封顶 300 秒。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"img","properties":{"src":"diagram:routing-circuit-breaker","alt":"一条渠道熔断之后怎么恢复","data-block":"true"},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"note"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这次试水是真实调用。在 BYOK 渠道上，它花的是你自己的凭据，限定 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"max_tokens: 1"}]},{"type":"text","value":" 把成本压到可以忽略，且一个冷却周期最多探一次，不是每次检查都探。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"不这样做的话，一条已经恢复的渠道要等到真实流量恰好证明它能用才会解封，对只配了一条渠道的账号来说，那意味着一次故障永远不会自己结束。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"自动降权慢渠道"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"不管调用方有没有传 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"provider.sort"}]},{"type":"text","value":"，一条比同模型下最快渠道慢 3 倍以上的渠道，会被当成不健康的一样处理：沉到正常渠道之下，但从不会彻底剔除（一个慢答案也好过没有答案），并且按上面权重那条说明，在它所在的那一档里也只能分到更小的一份流量。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"两个不同的健康页面"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"页面"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"接口"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"谁能看"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"粒度"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Model Health"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/health/models"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"所有人"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"按"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"模型"}]},{"type":"text","value":"给出 up / degraded"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"渠道健康"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/health/channels"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"只有 BYOK 渠道主人"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"点名你自己每一条渠道"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Model Health 的数据来自你自己最近的调用量，它从不点名供应商，因为一个模型背后接了哪几家是平台的商业信息。它本身永远只会说 up 或 degraded。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"停靠（parked）状态只在渠道健康页出现。详见 "},{"type":"element","tagName":"a","properties":{"href":"channels"},"children":[{"type":"text","value":"渠道"}]},{"type":"text","value":" 里的「查看自己渠道的健康状况」。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"窗口内没有流量就是没有数据，不代表「健康」。很少调用的模型样本也少。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"模型在窗口内的失败率越过阈值就标成 degraded，请求仍会照常路由。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"停靠的渠道在一次试探请求成功后自动恢复（见上面的「熔断」）。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"渠道时间线只记每条渠道什么时候停止服务、什么时候恢复，不逐条列失败请求。平台渠道不在列表里。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"页面每 30 秒刷新一次。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"兜底路由"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"模型名填 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"*"}]},{"type":"text","value":" 的路由是兜底路由，承接所有没有按名字配置过的模型，而不是返回「没有配置路由」。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Upstream name"}]},{"type":"text","value":" 在兜底路由里有两种语义："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Upstream name"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"行为"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"留空"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"把调用方请求的模型名原样转发给上游"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"填写"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"所有未配置模型都改用这一个上游模型作答"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"适合聚合网关的典型配置："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"Model = *\nChannel = openrouter-prod\nUpstream name = 留空\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这样调用方请求 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"anthropic/claude-..."}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"openai/gpt-..."}]},{"type":"text","value":" 等未配置模型时，模型名会原样交给 OpenRouter。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Upstream name 是个下拉，列的是你在所选渠道上配好的模型（录过进价的那些，见"},{"type":"element","tagName":"a","properties":{"href":"cost-prices"},"children":[{"type":"text","value":"进价"}]},{"type":"text","value":"）。这一格打错字不会报错：路由照样建得出来，错只体现在调用时被上游拒。选 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Something else…"}]},{"type":"text","value":" 可以手打一个不在列表里的名字，私有部署和别名是正当用法，这条路一直留着。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"warning"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"兜底只在某个模型没有任何路由时生效。模型配置过但渠道全部失败时返回失败，不会静默换一家；否则你会在自己请求的模型名下收到另一个模型的输出，且没有任何地方说明。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"修改兜底路由最多一分钟生效，因为已经解析过的模型会有短缓存。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"平台模型开关"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这组设置里有一个开关 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"enablePlatformModels"}]}]},{"type":"text","value":"（控制台里显示为 Scope → "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Use platform models"}]},{"type":"text","value":"）。默认 Router 走 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"PUT /v1/routing/settings"}]},{"type":"text","value":" 改，命名 Router 走 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"PUT /v1/routers/{id}"}]},{"type":"text","value":"（同一个字段名）。新建的 Router 创建时默认是开。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"打开时："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"平台共享模型可用。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"你自己的同名路由优先，平台路由可在后面兜底。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"关闭时："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"绑在这个 Router 上的每一把 key 都看不到平台模型。对默认 Router 来说，就是账号名下没单独绑过别的 Router 的所有子钥。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/models"}]},{"type":"text","value":" 不再返回平台模型。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"这些 key 只能使用你自己配置过的路由。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"对这些 key 来说，从它们下一次调用起生效，已经发出去的调用不会被撤回。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这组设置的读取接口是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/routing"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"允许未配置模型"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Scope 里还有 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Allow models with no route"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"打开后，没有显式路由的模型名可以原样转发到你指定的 Passthrough channel。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"关闭后，没有路由的模型返回 404。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这和 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"*"}]},{"type":"text","value":" 兜底路由很像，但在控制台里表现为 Router 级别设置。要注意：它依赖一个具体的 passthrough channel，且切换后最多一分钟生效。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"给某一把 key 单独配路由"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"路由默认对所有 key 生效。想让某一把 key 走别的渠道：在 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Routes"}]},{"type":"text","value":" 标题旁的选择框里选中它（默认显示 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"All keys"}]},{"type":"text","value":"）（或在 API Keys 页点这把 key 旁边的路由图标），然后照常加路由。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"这把 key 自己配了路由的模型，只走这几条；所有 key 共用的那几条不会混进来。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"其余模型照所有 key 共用的那套走，那边改了这把 key 也跟着变。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"计费、"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Use platform models"}]},{"type":"text","value":"、"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Allow models with no route"}]},{"type":"text","value":" 是账号级设置，每把 key 都一样。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"把这把 key 在某个模型上的路由删光，这个模型就回到所有 key 共用的那套。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"接口上，"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/routing"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routing/routes"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routing/routes/arrange"}]},{"type":"text","value":" 带上 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"apiKeyId"}]},{"type":"text","value":" 就是对这把 key 操作（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET"}]},{"type":"text","value":" 时 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"myRoutes"}]},{"type":"text","value":" 只返回它自己的那几条）。按 id 改、删路由不用带。"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/routing"}]},{"type":"text","value":" 还会返回 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"keyOverrides"}]},{"type":"text","value":"：哪些 key 有自己的路由、覆盖了哪些模型。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"已经绑了命名 Router（见下）的 key 不能再单独配路由，先解绑。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"provisioning"},"children":[{"type":"text","value":"母钥"}]},{"type":"text","value":"也能这样配路由，配的是它签出的子钥：子钥自己没配路由时跟母钥的走，母钥没配的模型照所有 key 共用的那套。这样的子钥要改路由就去母钥上改，不在子钥上改；"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/routing?apiKeyId=<子钥>"}]},{"type":"text","value":" 会在 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"inheritsFrom"}]},{"type":"text","value":" 里告诉你它跟的是哪把母钥。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"一个账号可以有多个 Router"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Routing 页默认编辑的是账号默认 Router。绝大多数账号到此为止就够了。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"往下一层看，那套默认路由其实是一个 Router，一个账号可以建不止一个。高级场景下用得上："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"测试 key 走便宜模型。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"生产 key 只走稳定供应商。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"某个客户只允许使用指定渠道。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"不同项目有不同 fallback 策略。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"img","properties":{"src":"diagram:routing-multi-router","alt":"一个账号可以有多个 Router","data-block":"true"},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"相关接口："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"操作"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"接口"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"列出/创建 Router"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routers"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"修改/删除 Router"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"PUT"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"DELETE /v1/routers/{id}"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"给 API key 绑定 Router"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/api-keys/bind-router"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"命名 Router 路由列表"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routers/{id}/routes"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"修改/删除命名 Router 路由"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"PUT"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"DELETE /v1/routers/{id}/routes/{routeId}"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"命名 Router 也有自己一整套路由，priority、weight、兜底规则跟默认 Router 完全一样。测试和智能编排也照样能用："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routers/{id}/routes/{routeId}/test"}]},{"type":"text","value":" 和 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST /v1/routers/{id}/routes/arrange"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"没绑定 Router 的 key 使用账号默认 Router。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"调用方临时指定备用模型："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"models"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"以上都是在 Routing 页配置一次、对所有调用生效的。"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"models"}]},{"type":"text","value":" 是同一个思路，但交给调用方，只对这一次调用生效。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-json"]},"children":[{"type":"text","value":"{\n  \"model\": \"GLM 5.1\",\n  \"models\": [\"GPT-5.6 Sol\", \"Claude Opus 5\"],\n  \"messages\": []\n}\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"执行顺序："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"model"}]},{"type":"text","value":" 仍然必填，且永远第一个被尝试。它带着自己配置好的全部路由、priority、weight 和兜底路由，和没有 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"models"}]},{"type":"text","value":" 时完全一样。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"只有 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"model"}]},{"type":"text","value":" 的所有路由都耗尽（压根没配，或者配了但候选全部熔断/失败）之后，才退到 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"models[0]"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"再不行尝试 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"models[1]"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"最多 5 个备用模型；超出的部分静默丢弃，不报错。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"回包的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"model"}]},{"type":"text","value":" 字段与向你收取的价格，反映的都是真正作答的那个模型。如果这次调用最后落到了 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"\"Claude Opus 5\""}]},{"type":"text","value":"，回包里写的就是它，不是你最先写的那个。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"warning"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"models"}]},{"type":"text","value":" 会被 Tare 自己消费掉，从不转发给上游。它和 OpenRouter 自己认识的一个字段同名，原样转发的话，OpenRouter 会拿着对它毫无意义的模型名，去跑它自己的一套转移逻辑。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"调用方临时指定渠道偏好："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"provider"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"请求里可以传 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"provider"}]},{"type":"text","value":"，只调整这一次调用的候选渠道，不用去改 Routing 页。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-json"]},"children":[{"type":"text","value":"{\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"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"字段"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"作用"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"order"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"按这个顺序优先尝试这些渠道名；除非关了 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"allow_fallbacks"}]},{"type":"text","value":"，解析出的其余候选跟在后面"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"only"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"白名单，候选列表里其余渠道全部去掉"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ignore"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"黑名单，去掉这些渠道"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"allow_fallbacks"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"默认 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"true"}]},{"type":"text","value":"。设为 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"false"}]},{"type":"text","value":" 时只允许 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"order"}]},{"type":"text","value":"/"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"only"}]},{"type":"text","value":" 点名的渠道；它们都打不通就直接失败，不会再试别的"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"sort"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"\"latency\""}]},{"type":"text","value":" 按实测平均延迟从快到慢重排，用的是默认路由排序本来就在用的那份数据"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"渠道名的匹配大小写不敏感，对照的是 Channels 和 Routing 页上显示的那个名字。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"warning"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"如果 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"only"}]},{"type":"text","value":"/"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ignore"}]},{"type":"text","value":"/"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"order"}]},{"type":"text","value":" 把候选过滤到一条都不剩，返回的是 400，不是 404。这样才能区分「你的偏好把候选都排除了」和「这个模型没有路由」。错误信息里会列出这个模型实际配置了哪些渠道，方便你核对是不是名字写错了。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"note"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"sort: \"price\""}]},{"type":"text","value":" 和 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"sort: \"throughput\""}]},{"type":"text","value":" 会被接受，但目前没有效果。很多 OpenRouter 兼容客户端默认就会带上这两个值，因不支持而拒绝调用，会连累一批本来和这个字段无关的请求。"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"price"}]},{"type":"text","value":" 目前也确实没有意义：平台定价按模型定，不按渠道定，同一个模型的不同渠道价格是一样的，没有价格可排。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"和 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"models"}]},{"type":"text","value":" 一样，"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"provider"}]},{"type":"text","value":" 对象会被 Tare 消费掉，不会到达你的上游。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"一次转移在时间上花了多少"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/generation"}]},{"type":"text","value":"（见"},{"type":"element","tagName":"a","properties":{"href":"endpoints"},"children":[{"type":"text","value":"接口列表"}]},{"type":"text","value":"）在一次调用真的转移过渠道时，会把 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"latency"}]},{"type":"text","value":" 和 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"generation_time"}]},{"type":"text","value":" 分开给："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"generation_time"}]},{"type":"text","value":" 是真正作答的那家花的时间。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"latency"}]},{"type":"text","value":" 在此基础上加上了转移之前那几家失败尝试各自的耗时。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"两者之差 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"routing_overhead_ms"}]},{"type":"text","value":" 只在真的转移过时才出现，让你不用翻调用详情就能分清「这个模型本来就慢」还是「前面先打到一个死渠道上」。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"多模态"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"路由可以声明其渠道接受哪些输入类型，带图片的请求只会发给声明接受图片的路由。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"未声明的路由不会被排除。「未声明」按「未知，不排除」处理，否则这个字段启用的那一刻，所有带图请求会同时失去全部候选。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"note"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这一条现在还不能自助配置：改路由的接口还没有输入类型这个字段。有路由需要声明，请联系我们。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"本地节点与路由"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"客户自建节点上的渠道按同样的规则分流：Priority 决定先后，同一档里按会话和 Weight 分到各条渠道。节点报回的成败会更新渠道健康。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"节点不在时，直连节点的调用失败，不会退回 Tare 服务器代发。要走服务端，就不要把这条渠道标成 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"LOCAL_NODE"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"不想自建时可以用官方节点 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://tare-node.jamerly.ai"}]},{"type":"text","value":"，它不在你的网络里。见 "},{"type":"element","tagName":"a","properties":{"href":"local-nodes"},"children":[{"type":"text","value":"本地节点"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"SOP：新增一条稳定路由"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"在 Channels 页确认渠道已经添加。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"对渠道执行 Test 和 Chat。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"在 Cost prices 中确认目标上游模型存在，或确认上游会回包报告真实成本。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"打开 Routing。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"填写对外 Model 名。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"选择 Channel。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"选择或填写 Upstream name。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"第一条路由设为 Primary，weight 保持 1。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"第二条及以后备用路由设为 Fallback。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"对每条路由执行测试。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"用业务 key 发真实请求。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"在 Call Traces 或 generation 查询里确认实际命中的模型、渠道、延迟和成本。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"最小验收清单"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{"className":["contains-task-list"]},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"每个对外模型名都有预期路由。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"Model 和 Upstream name 的命名边界清楚。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"Primary / Fallback 顺序符合业务预期。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"同层 Weight 比例符合预期。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"要暂停的路由使用关闭开关，而不是把 weight 设为 0。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"兜底路由或 passthrough 设置已经明确开/关。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"平台模型开关符合当前 Router 的业务范围。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"路由测试通过。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{"className":["task-list-item"]},"children":[{"type":"element","tagName":"input","properties":{"type":"checkbox","checked":false,"disabled":true},"children":[]},{"type":"text","value":" "},{"type":"text","value":"真实调用返回的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"model"}]},{"type":"text","value":" 和命中渠道符合预期。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"下一步"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这三篇是一条链，按顺序读：接渠道 → 录进价 → 配路由。你现在做完了第三步。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"上一步：还没录进价，读 "},{"type":"element","tagName":"a","properties":{"href":"cost-prices"},"children":[{"type":"text","value":"进价"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"更前一步：还没接渠道，读 "},{"type":"element","tagName":"a","properties":{"href":"channels"},"children":[{"type":"text","value":"渠道"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"想让 BYOK 从你自己的网络直连上游：读 "},{"type":"element","tagName":"a","properties":{"href":"local-nodes"},"children":[{"type":"text","value":"本地节点"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"想看每次调用实际命中哪条路由：读 "},{"type":"element","tagName":"a","properties":{"href":"content-retention"},"children":[{"type":"text","value":"Call Traces"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"遇到不认识的词：翻 "},{"type":"element","tagName":"a","properties":{"href":"glossary"},"children":[{"type":"text","value":"术语表"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"}]}]}