{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"What this covers"}]},{"type":"text","value":": using Tare as the model upstream for coding tools such as Claude Code, Codex, Cursor, Cline and OpenCode. Calls use your own Tare API key and go through your own routes and billing."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Switch Claude Code and Codex with one command"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"On macOS, Linux and WSL, run:"}]},{"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":"The script asks once for your Tare API key, then takes Claude Code and Codex one at a time: it asks whether to switch that tool, lists the models in your routes with their prices, and has you pick its models (for Claude Code, a main model and a small model for background tasks). It makes one test call for that tool and only then writes its file: the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"env"}]},{"type":"text","value":" block in "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"~/.claude/settings.json"}]},{"type":"text","value":", or "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"~/.codex/config.toml"}]},{"type":"text","value":". A tool you say no to is not touched. If the test call fails, the script asks before writing anyway. Other settings in those files are left alone, and each file gets a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":".bak-tare-<time>"}]},{"type":"text","value":" backup first. Restart "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"claude"}]},{"type":"text","value":" or "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"codex"}]},{"type":"text","value":" to pick up the change."}]},{"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":"Option"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Purpose"}]},{"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":"Use this key without asking"}]},{"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 <model>"}]},{"type":"text","value":", "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--fast-model <model>"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Use these models without asking ("},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--model"}]},{"type":"text","value":" applies to both tools)"}]},{"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":"Switch only that tool, without asking"}]},{"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":"Put back the configuration from before the switch, asking for each tool"}]},{"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":"No questions: switch every tool installed on this machine, with the default models"}]},{"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":"Run it again to change models. The sections below show what the script writes, for configuring by hand."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Address"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Each coding tool speaks one API. "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://tare.jamerly.ai"}]},{"type":"text","value":" accepts all three, so the address is always the same; only whether to add "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1"}]},{"type":"text","value":" depends on the tool."}]},{"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":"API the tool speaks"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Tools"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Address"}]},{"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 and similar"}]},{"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":"With a "},{"type":"element","tagName":"a","properties":{"href":"local-nodes"},"children":[{"type":"text","value":"local node"}]},{"type":"text","value":" installed, any of the three can point at the node on the same machine instead: "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"http://127.0.0.1:8090"}]},{"type":"text","value":" (add "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1"}]},{"type":"text","value":" for the OpenAI shapes). Calls through your own node send "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"LOCAL_NODE"}]},{"type":"text","value":" channels and "},{"type":"element","tagName":"a","properties":{"href":"subscription-supply"},"children":[{"type":"text","value":"subscription channels"}]},{"type":"text","value":" out from your own network."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"What you need"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"An "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Inference key"}]},{"type":"text","value":" (Console → "},{"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":"). Create one per tool so usage and limits can be read separately."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"A model name from "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/models"}]},{"type":"text","value":" or the "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Routing"}]},{"type":"text","value":" page, for example "},{"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":" or "},{"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":"Every tool can use every model in your routes. Claude Code can call Kimi, GLM or GPT; Tare translates between the two APIs, streaming and tool calls included. Coding tools depend on tool calling, so pick models that support it."}]},{"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":"Add this to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"~/.claude/settings.json"}]},{"type":"text","value":" (or to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":".claude/settings.json"}]},{"type":"text","value":" inside a project to scope it to that project):"}]},{"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\": \"<your 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":"Or set them for the current shell only:"}]},{"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=<your 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":"Variable"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Purpose"}]},{"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":"No "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1"}]},{"type":"text","value":"; Claude Code appends "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/v1/messages"}]},{"type":"text","value":" itself"}]},{"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":"Your Tare key, sent as "},{"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":" also works; the node accepts both headers"}]},{"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":"Default model"}]},{"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":"text","value":"The models behind the three tiers in "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/model"}]},{"type":"text","value":". Claude Code runs background tasks such as titles and summaries on the Haiku tier, so a cheaper model there saves money"}]},{"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":"No Anthropic login is needed once these are set. With a non-Claude model, Claude Code prints a notice at startup that it does not recognize the model name and assumes a 200k context window. Calls are not affected."}]},{"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":"Add this to "},{"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":"The key is read from the variable named in "},{"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=<your 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":" must be "},{"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":" can be any model in your routes."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"OpenAI-compatible tools"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In Cursor, Cline, Roo Code, Kilo Code, Continue, Zed, Cherry Studio and similar tools, choose OpenAI Compatible in the model settings (some call it Custom OpenAI or Override OpenAI Base URL) and fill in three values:"}]},{"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":"Setting"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"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":"Your 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":"A model name from your routes, for example "},{"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":"For OpenCode, put this in "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"opencode.json"}]},{"type":"text","value":" at the project root (or in "},{"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":"Using your own subscriptions and channels"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Calls from a tool follow your routes exactly like calls from application code:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"To send a model to your own upstream account, add it under "},{"type":"element","tagName":"a","properties":{"href":"channels"},"children":[{"type":"text","value":"Channels"}]},{"type":"text","value":" and point a "},{"type":"element","tagName":"a","properties":{"href":"routing"},"children":[{"type":"text","value":"route"}]},{"type":"text","value":" at it."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"To use a coding subscription you already pay for (GLM Coding Plan, Kimi For Coding and others), create a subscription channel as in "},{"type":"element","tagName":"a","properties":{"href":"subscription-supply"},"children":[{"type":"text","value":"Sharing a subscription"}]},{"type":"text","value":" and give it a route."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"To use capacity sold on the "},{"type":"element","tagName":"a","properties":{"href":"token-market"},"children":[{"type":"text","value":"Token Market"}]},{"type":"text","value":", add the listing to a route."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Checking it works, and usage"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Console → "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Call Traces"}]},{"type":"text","value":", filtered by key, shows one row per call: model, channel, tokens and cost."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"A single session makes many calls (every file read and every command is one), so usage runs far higher than chat. Set a lifetime limit on the key (see "},{"type":"element","tagName":"a","properties":{"href":"auth"},"children":[{"type":"text","value":"API keys"}]},{"type":"text","value":") so a runaway task stops at the limit."}]},{"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":"Symptom"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Cause"}]},{"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":"Wrong key, or the key is disabled or expired"}]},{"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":"The model name is not in your routes; use a name from "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/models"}]}]},{"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":"Blocked by a limit, budget, source IP rule or data protection; see "},{"type":"element","tagName":"a","properties":{"href":"errors"},"children":[{"type":"text","value":"Errors"}]}]},{"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":"Related: "},{"type":"element","tagName":"a","properties":{"href":"quickstart"},"children":[{"type":"text","value":"Quickstart"}]},{"type":"text","value":", "},{"type":"element","tagName":"a","properties":{"href":"local-nodes"},"children":[{"type":"text","value":"Local Nodes"}]},{"type":"text","value":", "},{"type":"element","tagName":"a","properties":{"href":"routing"},"children":[{"type":"text","value":"Routing"}]},{"type":"text","value":"."}]}]}