Claude Code through OpenRouter or the Zukko gateway: setup and differences
Claude Code connects to both services through an Anthropic-compatible entry point. We show the configs side by side, the differences in model names, the connection check, and how cache affects the bill.
6 min · · IDE · сравнение
Claude Code can be pointed at a third-party service instead of an Anthropic account login: you need an address, a token and, usually, a model name. If you are choosing between OpenRouter and the Zukko gateway, below is a comparison of how Claude Code connects through OpenRouter and through our gateway, which differences there are in variables and model names, and how this shows up on the bill. The OpenRouter description comes from their Claude Code documentation at the time of checking; their terms change, so check the service's page.
What they have in common
Both services have an Anthropic Messages entry point, so Claude Code talks to them in its native protocol, with no local proxy. Both use ANTHROPIC_BASE_URL for the address and ANTHROPIC_AUTH_TOKEN for the key: the token goes in the Authorization: Bearer header. In both cases the address is given without the /v1 suffix, because Claude Code adds the /v1/messages path itself.
Setup through OpenRouter
According to the OpenRouter docs, three actions are needed.
- The address:
https://openrouter.ai/api, in full, with the scheme. - Your OpenRouter key in
ANTHROPIC_AUTH_TOKEN. - The variable that normally holds an Anthropic API key must be explicitly set to an empty string to avoid a conflict.
An example in a shell profile per the docs (the Anthropic API key variable that they blank out is omitted here; take its line from the OpenRouter docs):
export OPENROUTER_API_KEY="<your key>"
export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"The docs then list steps that are easy to forget. If you previously signed in to Claude Code with an Anthropic account, run /logout and restart claude: the stored login conflicts with the gateway token. Then use the /status command to check that the token line names ANTHROPIC_AUTH_TOKEN and the address shows https://openrouter.ai/api. An important warning from the docs: Claude Code with OpenRouter is guaranteed to work only with the first-party Anthropic provider, and for best compatibility they advise putting it first in the provider priority.
Models are reassigned with the variables ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL and CLAUDE_CODE_SUBAGENT_MODEL, and the docs give names in their format (provider, slash, model; there are also "latest" aliases). For a 1M token window, their docs add the [1m] suffix to the name: without it Claude Code assumes a 200k window and compacts context earlier. The model picker in the /model menu is enabled by a separate variable on their side.
Setup through Zukko
For Zukko the setup takes one file. Per the Claude Code docs it is ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.zukko.pro",
"ANTHROPIC_AUTH_TOKEN": "fetch_your_key",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-5-5"
}
}The three slots in the /model menu (Opus, Sonnet, Haiku) are reassigned to models from GET /v1/models. If the file already exists, merge the env block into it rather than overwriting the whole config: a trailing comma makes the file invalid and the settings silently stop being read. To verify, ask any question and look at the charge in your account. If Claude Code asks you to sign in to Anthropic, the token is not visible: check the variable name and run /logout; more in Claude Code asks to sign in to Anthropic.
Of the gateway's two formats (Anthropic and OpenAI), Claude Code needs the Anthropic one.
Side by side
| OpenRouter | Zukko | |
|---|---|---|
| Address | https://openrouter.ai/api | https://api.zukko.pro |
| Key variable | ANTHROPIC_AUTH_TOKEN | ANTHROPIC_AUTH_TOKEN |
| Model names | "provider/model" format, aliases exist | plain ids: claude-sonnet-5-5, claude-opus-5-5 |
| 1M window | [1m] suffix on the name | Claude models have 1M in the table; the suffix is not described in the docs |
| Check | /status | the first answer and spend in your account |
| Payment | cards, Alipay, USDC, fee when buying | SBP (+8.5% on the payment page), crypto, MasterCard (about 13%) |
| Limits | see the service documentation | daily and monthly limit per key, a list of allowed models |
About the 1M window on Zukko. The OpenRouter documentation says Claude Code assumes a 200k window unless the model name ends in [1m], and so compacts the context earlier. Claude models have a 1M context in the Zukko table, but the [1m] suffix is not described in the Zukko docs, so we do not recommend it: check how your Claude Code version reports the window after setup, and if in doubt, consult the Zukko docs.
How this shows on the bill
For long agent sessions cache decides. In the Anthropic format the gateway sees how much input came from cache and how much was written to it, and bills each part at its own price. Suppose a session on claude-sonnet-5-5:
- fresh input 0.2M tokens;
- cache read 2.5M;
- cache write 0.3M;
- output 0.1M.
Zukko prices as of October 18, 2026: input 0.4, cache read 0.05, cache write 0.5, output 2 dollars per million. By the formula "fresh input × input price + read × read price + write × write price + output × output price":
0.2 × 0.4 + 2.5 × 0.05 + 0.3 × 0.5 + 0.1 × 2 = 0.08 + 0.125 + 0.15 + 0.2 = $0.555.
If the same 3.0M input tokens went through the OpenAI format, where all input for Claude is billed at the input price, it would be 3.0 × 0.4 + 0.1 × 2 = 1.2 + 0.2 = $1.40. That is why Claude Code needs an Anthropic-compatible entry point, and both services have one. How OpenRouter accounts for cache on a particular model and provider, look at the model page and your activity panel: we do not calculate those figures for them. More on this: Claude via /v1/messages or /v1/chat/completions: what happens to cache.
Current Zukko prices: GET https://api.zukko.pro/v1/models or the "Models" page in your account.
What to choose
- If you need the widest model catalog and the service's payment method works for you, OpenRouter is a reasonable option.
- If you need payment by SBP, MasterCard or crypto, Claude prices below official ones and separate keys with per-project limits, look at Zukko.
- If you are unsure, set up both and run the same small task, comparing spend in the panels.
A Zukko key is created in your account. There are three ways to pay from Russia: SBP, MasterCard cards and cryptocurrency. For a general comparison of the services see Zukko vs OpenRouter.
FAQ
Can I keep both connections?
Yes, switch with a settings file or environment variables. Just make sure variables from the second service do not linger in the environment: shell variables and settings.json can override each other.
What if Claude Code asks me to sign in to Anthropic?
Check that the key is passed specifically in ANTHROPIC_AUTH_TOKEN, that the JSON in settings.json is valid, and run /logout.
Can I run Claude Code on a non-Anthropic model?
Technically, through a gateway you can specify any model from the list, but Claude Code is built for Claude, and the OpenRouter docs state directly that it may not work correctly with other providers. Test on your own tasks.
Which way is cheaper?
It depends on the model, the cache and the payment method. Calculate a session with the formula above using both services' prices on the day of the calculation.
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.
Related articles
- GitHub Copilot alternatives with your own API key: what to chooseCline, Kilo Code, Continue and Cursor work with your own key. We compare where they live, how they connect to a gateway and how to estimate spend.
- Zed AI vs Cursor: a fast editor against an AI fork of VS CodeZed and Cursor approach AI differently: one builds around its own editor and the ACP protocol, the other extends VS Code. We compare them and connect your own key.
- JetBrains AI vs Cursor: what a developer on IntelliJ and PyCharm should pickStay in a JetBrains IDE with AI Assistant or move to Cursor? We compare features, own-model support and costs, with step-by-step settings.
- Cline or Cursor: what to pick if you want to pay only for tokensCline is a free extension and you pay the provider for tokens. Cursor is sold as a product. We compare payment, context control and agent features and price a month of work.