{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"这篇解决什么问题"}]},{"type":"text","value":"：让 Claude Code、Codex、Cursor、Cline、OpenCode 这类编程工具用 Tare 作为模型上游。用的是你自己的 Tare API key，走你自己的路由和账单。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"一条命令切换 Claude Code 和 Codex"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"macOS、Linux 和 WSL 上运行："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"bash <(curl -fsSL https://www.jamerly.ai/tare/connect.sh)\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"脚本问一次 Tare API key，然后 Claude Code 和 Codex 一个一个来：先问要不要切这个工具，再列出你路由里的模型和价格让你选它用的模型（Claude Code 选主模型和后台任务用的小模型），试调一次，通过了才写它的文件："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"~/.claude/settings.json"}]},{"type":"text","value":" 的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"env"}]},{"type":"text","value":"，或 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"~/.codex/config.toml"}]},{"type":"text","value":"。你说不切的工具一点不动；试调没通过，会先问你还写不写。文件里原有的其它设置不动，改之前留一份 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":".bak-tare-<时间>"}]},{"type":"text","value":" 备份。重开 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"claude"}]},{"type":"text","value":" 或 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"codex"}]},{"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":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--key <key>"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"不提问，直接用这把 key"}]},{"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":"--model <模型>"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--fast-model <模型>"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"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":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--claude-only"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--codex-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":"--restore"}]}]},{"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":"-y"}]}]},{"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":"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":"https://tare.jamerly.ai"}]},{"type":"text","value":" 三种都认，地址都是它，只是要不要带 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1"}]},{"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":"OpenAI Chat Completions"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Cursor、Cline、Roo Code、Kilo Code、Continue、OpenCode、Aider、Zed、Cherry Studio 等"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://tare.jamerly.ai/v1"}]}]},{"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":"Anthropic Messages"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Claude Code"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://tare.jamerly.ai"}]}]},{"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":"OpenAI Responses"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Codex CLI"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://tare.jamerly.ai/v1"}]}]},{"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":"local-nodes"},"children":[{"type":"text","value":"本地节点"}]},{"type":"text","value":"的话，这三类都可以改成打本机节点 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"http://127.0.0.1:8090"}]},{"type":"text","value":"（OpenAI 形状加 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1"}]},{"type":"text","value":"）。经本机节点调用时，标了 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"LOCAL_NODE"}]},{"type":"text","value":" 的渠道和"},{"type":"element","tagName":"a","properties":{"href":"subscription-supply"},"children":[{"type":"text","value":"订阅渠道"}]},{"type":"text","value":"从你自己的网络出去。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","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":"strong","properties":{},"children":[{"type":"text","value":"Inference key"}]},{"type":"text","value":"（控制台 → "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"API Keys"}]},{"type":"text","value":" → "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Create"}]},{"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":"GET /v1/models"}]},{"type":"text","value":" 或控制台 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Routing"}]},{"type":"text","value":" 页里的名字，例如 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"moonshotai/kimi-k3"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"anthropic/claude-sonnet-5.5"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"openai/gpt-6.1-sol"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"任何工具都能用路由里的任何模型：Claude Code 也能调 Kimi、GLM、GPT，Tare 负责在两种接口之间翻译，包括流式和工具调用。编程工具大量依赖工具调用，选模型时挑支持工具调用的。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Claude Code"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"写进 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"~/.claude/settings.json"}]},{"type":"text","value":"（只对某个项目生效就写进项目里的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":".claude/settings.json"}]},{"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  \"env\": {\n    \"ANTHROPIC_BASE_URL\": \"https://tare.jamerly.ai\",\n    \"ANTHROPIC_AUTH_TOKEN\": \"<你的 Tare Inference key>\",\n    \"ANTHROPIC_MODEL\": \"anthropic/claude-sonnet-5.5\",\n    \"ANTHROPIC_DEFAULT_OPUS_MODEL\": \"anthropic/claude-opus-5.5\",\n    \"ANTHROPIC_DEFAULT_SONNET_MODEL\": \"anthropic/claude-sonnet-5.5\",\n    \"ANTHROPIC_DEFAULT_HAIKU_MODEL\": \"z-ai/glm-5.3\"\n  }\n}\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-bash"]},"children":[{"type":"text","value":"export ANTHROPIC_BASE_URL=https://tare.jamerly.ai\nexport ANTHROPIC_AUTH_TOKEN=<你的 Tare Inference key>\nexport ANTHROPIC_MODEL=moonshotai/kimi-k3\nclaude\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":"ANTHROPIC_BASE_URL"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"不带 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1"}]},{"type":"text","value":"，Claude Code 自己拼 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1/messages"}]}]},{"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":"ANTHROPIC_AUTH_TOKEN"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Tare 的 key，以 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Authorization: Bearer"}]},{"type":"text","value":" 发出。用 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ANTHROPIC_API_KEY"}]},{"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":"ANTHROPIC_MODEL"}]}]},{"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":"ANTHROPIC_DEFAULT_OPUS_MODEL"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"_SONNET_MODEL"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"_HAIKU_MODEL"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/model"}]},{"type":"text","value":" 里三档分别对应的模型。Claude Code 起标题、做摘要这类后台小任务用 Haiku 那一档，设成便宜的模型能省钱"}]},{"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":"设好之后不需要登录 Anthropic 账号。用的不是 Claude 模型时，Claude Code 启动会提示不认识这个模型名、按 200k 上下文处理，不影响调用。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Codex CLI"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"写进 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"~/.codex/config.toml"}]},{"type":"text","value":"："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-toml"]},"children":[{"type":"text","value":"model = \"openai/gpt-6.1-sol\"\nmodel_provider = \"tare\"\n\n[model_providers.tare]\nname = \"Tare\"\nbase_url = \"https://tare.jamerly.ai/v1\"\nenv_key = \"TARE_API_KEY\"\nwire_api = \"responses\"\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"key 从 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"env_key"}]},{"type":"text","value":" 指定的环境变量里读："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"export TARE_API_KEY=<你的 Tare Inference key>\ncodex\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"wire_api"}]},{"type":"text","value":" 要写 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"responses"}]},{"type":"text","value":"。"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"model"}]},{"type":"text","value":" 换成路由里的任何模型都行。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"OpenAI 兼容的工具"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Cursor、Cline、Roo Code、Kilo Code、Continue、Zed、Cherry Studio 这类工具，在模型设置里选 OpenAI Compatible（有的叫 Custom OpenAI 或 Override OpenAI Base URL），填三项："}]},{"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":"Base URL"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://tare.jamerly.ai/v1"}]}]},{"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"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"你的 Tare Inference key"}]},{"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":"Model"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"路由里的模型名，例如 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"moonshotai/kimi-k3"}]}]},{"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":"OpenCode 写进项目根目录的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"opencode.json"}]},{"type":"text","value":"（或 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"~/.config/opencode/opencode.json"}]},{"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  \"$schema\": \"https://opencode.ai/config.json\",\n  \"provider\": {\n    \"tare\": {\n      \"npm\": \"@ai-sdk/openai-compatible\",\n      \"name\": \"Tare\",\n      \"options\": {\n        \"baseURL\": \"https://tare.jamerly.ai/v1\",\n        \"apiKey\": \"{env:TARE_API_KEY}\"\n      },\n      \"models\": {\n        \"moonshotai/kimi-k3\": { \"name\": \"Kimi K3\" },\n        \"z-ai/glm-5.3\": { \"name\": \"GLM 5.3\" }\n      }\n    }\n  },\n  \"model\": \"tare/moonshotai/kimi-k3\"\n}\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":"工具打到 Tare 的调用按你的路由走，和业务代码没有区别："}]},{"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":"channels"},"children":[{"type":"text","value":"渠道"}]},{"type":"text","value":" 接进来，再在 "},{"type":"element","tagName":"a","properties":{"href":"routing"},"children":[{"type":"text","value":"路由"}]},{"type":"text","value":" 里指过去。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"想用自己手上的编程订阅（GLM Coding Plan、Kimi For Coding 等），按 "},{"type":"element","tagName":"a","properties":{"href":"subscription-supply"},"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":"token-market"},"children":[{"type":"text","value":"Token 市场"}]},{"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":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"控制台 → "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Call Traces"}]},{"type":"text","value":" 按 key 筛选，每次调用都有一行：模型、渠道、token 数和费用。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"一个会话里工具会发很多次调用（读文件、跑命令每一步都是一次），用量比聊天高得多。给这把 key 设上累计额度（见 "},{"type":"element","tagName":"a","properties":{"href":"auth"},"children":[{"type":"text","value":"API Key"}]},{"type":"text","value":"），失控的任务会停在上限。"}]},{"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":"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":"401"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"key 填错，或者这把 key 已停用、已过期"}]},{"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 / model not found"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"模型名不在你的路由里，用 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/models"}]},{"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":"403"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"额度、预算、来源 IP 或数据保护拦截，见 "},{"type":"element","tagName":"a","properties":{"href":"errors"},"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":"quickstart"},"children":[{"type":"text","value":"快速上手"}]},{"type":"text","value":"、"},{"type":"element","tagName":"a","properties":{"href":"local-nodes"},"children":[{"type":"text","value":"本地节点"}]},{"type":"text","value":"、"},{"type":"element","tagName":"a","properties":{"href":"routing"},"children":[{"type":"text","value":"路由"}]},{"type":"text","value":"。"}]}]}