Claude Code Router: do you need it if the gateway speaks the Anthropic format

Claude Code Router appeared to point Claude Code at other providers' models. If the gateway already accepts the Anthropic format, much of that is one variable.

6 min · · агенты · development

Claude Code Router appeared for a simple purpose: to make Claude Code work with models that do not speak the Anthropic format. If you search for "claude code router", you most likely want to run Claude Code on Qwen, GLM or DeepSeek. Often you do not need a router for that: the Zukko gateway accepts the Anthropic format for any of its models. Below we look at what the router does now, how to do without it, and when it is still useful.

The router description is checked against the README of musistudio/claude-code-router (version 3.1.3 at the time of checking), and Claude Code's behavior against the official documentation on 18 October 2026. Zukko prices are given for the same date.

What Claude Code Router is today

The router used to be a small utility with a configuration file. According to the README, it is now a local gateway and control panel for agents: one application from which Claude Code, Codex, OpenCode, Kilo Code and other agents take a single local address, while providers, models and routing rules are configured in one place. There are two ways to install it: a desktop app or an npm package (Node.js 22 or newer is required):

bash
npm install -g @musistudio/claude-code-router
ccr ui

Per the README, the order is then: in Providers you add a provider (a preset or your own address), choose a protocol and models; in Server you start the local gateway (by default http://127.0.0.1:3456); in Agent Config you choose Claude Code, the model you want, and apply the profile. The web interface from ccr ui opens at http://127.0.0.1:3458.

A warning: the internet has plenty of guides to the old router with manual editing of a configuration file. Section and key names in them may not match the current version, so rely on the README and the project's documentation.

What the router offers according to the project: routing by conditions (headers and request body), retries and a list of fallback models, key pools, a request log with tokens and cost estimates, and separate client keys with local limits.

Claude Code Router is needed if the provider does not understand the Anthropic format

Claude Code speaks the Anthropic format (/v1/messages). Many model providers expose only the OpenAI format (/v1/chat/completions). A translator is needed between them, and the router is exactly that. If your gateway already accepts the Anthropic format for all models, the translator is not needed.

In Zukko any model can be called in any format. So Claude Code points straight at the gateway:

bash
export ANTHROPIC_BASE_URL=https://api.zukko.pro
export ANTHROPIC_AUTH_TOKEN=fetch_your_key
export ANTHROPIC_MODEL=glm-5.3-flash
claude

The address has no /v1 because Claude Code adds the path itself. The key goes through ANTHROPIC_AUTH_TOKEN. Details are in the Claude Code guide and in the format comparison Anthropic or OpenAI.

Claude Code and the Qwen API

For "claude code qwen api" only the model name changes. The catalog has qwen3.8-max (input 0.088, output 0.238 dollars per 1M tokens, 1M context, image input supported, strength index 45) and the cheap qwen3.8-flash (0.038 / 0.075, 1M context, index 40):

bash
export ANTHROPIC_MODEL=qwen3.8-max
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4.1-flash

Claude Code uses not one model but several slots. According to Claude Code's documentation these are ANTHROPIC_MODEL (the session model), plus ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL (aliases and background tasks). You can switch models during work with the /model command. The same variables can go into the env block of ~/.claude/settings.json. On choosing by slot: which model to pick for Claude Code.

Two caveats

Support. Claude Code's documentation on gateways states directly that Anthropic does not support routing Claude Code to non-Claude models through any gateway. It works technically, but check tool behavior and quality on your own tasks. We do not claim another model will handle agent work equally well.

Context window. For ids that do not start with claude-, Claude Code does not know the real context window. Per the documentation, for an unrecognized id it assumes a 200K window, warns about this at startup and compacts history at that boundary. For GLM with its 128K window, give the real size in an environment variable:

bash
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=128000

For Zukko models with a 1M window (Qwen, DeepSeek, most of the rest), set the value to 1000000, otherwise history will be compacted already at 200K.

Claude Code with OpenRouter and other aggregators

The query "claude code openrouter" comes from people who already work through an aggregator. The principle is the same for all: Claude Code needs an Anthropic-compatible address and a token, and which models are available and how they are billed is set by the service. Take OpenRouter's details from its own documentation. A comparison of approaches is in Zukko vs OpenRouter.

When a router is still useful

If one variable is not enough, a router is justified. Typical cases:

  • you need rules: long context to one model, background tasks to a cheap one, all automatic;
  • you need a list of fallback models for provider errors;
  • you use several agents at once (Claude Code, Codex, OpenCode) and want a single local address;
  • you need a local log with tokens and cost estimates;
  • the provider has only the OpenAI format.

Without a router you have fewer moving parts: no local process to keep running and no second place for configuration to break. Part of these tasks is covered by Zukko keys themselves: each has its own daily and monthly limit in dollars and a list of allowed models (allowed_models), and spend history is visible in the dashboard under "Usage".

A router and Zukko together

If you do install a router, the Zukko gateway connects to it as a regular provider. Choose the protocol like this:

  • OpenAI Chat with the address https://api.zukko.pro/v1 works for all models, but Claude in the OpenAI format gets no cache discount;
  • Anthropic Messages keeps the cache for Claude; give the address by the rule for clients that add /v1 themselves, that is https://api.zukko.pro. If the router's connection check returns 404, check that suffix against the project's documentation.

What this means in money is clear from an example. Prices as of 18 October 2026: claude-sonnet-5-5 costs 0.4 for input, 2 for output, 0.05 for cache reads and 0.5 for cache writes, dollars per 1M tokens. A session: 300K fresh input tokens, 2M read from the cache, 100K written to the cache, 40K output tokens.

  • Anthropic format: 0.3 × 0.4 + 2 × 0.05 + 0.1 × 0.5 + 0.04 × 2 = 0.12 + 0.10 + 0.05 + 0.08 = $0.35;
  • OpenAI format (all input at the input price): (0.3 + 2 + 0.1) × 0.4 + 0.04 × 2 = 0.96 + 0.08 = $1.04.

Cache shares depend on your session. For comparison, the same volume (2.4M input and 40K output) on glm-5.3-flash costs 2.4 × 0.04 + 0.04 × 0.04 = $0.0976. For GPT models, cache reads are visible in both formats.

How to choose

  1. You need Claude Code on one or two Zukko models: set environment variables, no router needed.
  2. You need routing conditions, fallback models and a shared log: install a router and connect Zukko as a provider.
  3. You work with Claude and the cache matters: the Anthropic format directly, or the Anthropic Messages protocol in the router.
  4. In any case, test the model on your own tasks and create a separate key with a daily limit.

Claude Code on any of these models needs one fetch_... key from the dashboard. The balance is topped up via SBP (the payment page adds 8.5% on top), MasterCard, or crypto.

FAQ

Do I need claude-code-router to run Claude Code on GLM or Qwen through Zukko?

No. The gateway accepts the Anthropic format for any model: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN and the right id in ANTHROPIC_MODEL are enough.

What happens if I put an address with /v1 for Claude Code?

Claude Code adds the path itself, and requests go to /v1/v1/messages and fail with 404. For Claude Code and the Anthropic SDK the address is https://api.zukko.pro without /v1.

Will other models work in Claude Code as well as Claude?

It is not known in advance. Anthropic does not support this setup, and models call tools differently. Test on a real task and compare the cost.

Which models can I plug in?

Any from GET https://api.zukko.pro/v1/models: for example claude-sonnet-5-5, claude-opus-5-5, gpt-6.1-sol, qwen3.8-max, glm-5.3-flash, deepseek-v4.1-flash.

zukko

Pay 25×
less

for Claude Code & ChatGPT

One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.

Get API keyDocumentation

api.zukko.pro · fetch_*

Claude Code Router: needed with an Anthropic gateway? · Zukko