Claude Code with Qwen, GLM and DeepSeek models through one key
Claude Code is not tied to Claude: the model is set by a variable. A configuration for Qwen, GLM and DeepSeek, a session calculated, and how to keep Opus for the hard parts.
7 min · · IDE · экономия
Claude Code is a terminal agent, and its model is not hard-wired but set by an environment variable. The gateway accepts Anthropic-format requests for any catalogue model, so instead of Claude you can run Qwen, GLM or DeepSeek in it without changing the tool or the key. Below: how to set it up, what changes in price and capabilities, and how to keep Opus at hand for hard tasks.
How Claude Code chooses a model
Claude Code uses not one model but several "slots". We checked the variable names against the Claude Code documentation (the Model configuration and Environment variables pages); your version's list may differ:
| Variable | What it controls |
|---|---|
ANTHROPIC_MODEL | the default session model |
ANTHROPIC_DEFAULT_OPUS_MODEL | what the opus alias turns into |
ANTHROPIC_DEFAULT_SONNET_MODEL | the sonnet alias |
ANTHROPIC_DEFAULT_HAIKU_MODEL | the haiku alias and background tasks |
The value of each variable is a model identifier from the Zukko catalogue. There is also an ANTHROPIC_DEFAULT_FABLE_MODEL slot for the fable alias.
Configuration: a cheap model by default, Opus on command
The idea: the main work runs on an inexpensive model, and for hard tasks you switch to claude-opus-5-5 with /model opus. So we set a cheap model as the main one and leave the Opus slot on Claude.
export ANTHROPIC_BASE_URL=https://api.zukko.pro
export ANTHROPIC_AUTH_TOKEN=fetch_your_key
export ANTHROPIC_MODEL=qwen3.8-max
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=qwen3.8-max
export ANTHROPIC_DEFAULT_HAIKU_MODEL=qwen3.8-flashThe same values can go into the env block of ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.zukko.pro",
"ANTHROPIC_AUTH_TOKEN": "fetch_your_key",
"ANTHROPIC_MODEL": "qwen3.8-max",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.8-max",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3.8-flash"
}
}The address has no /v1: Claude Code adds it itself. The key goes specifically into ANTHROPIC_AUTH_TOKEN. Installation and first steps are in the Claude Code docs. To change the model on the fly inside a session, use the /model command (check the alias list and exact syntax in the documentation for your version). If you need a specific model, you can pass the --model flag with its identifier at launch.
For other variants substitute identifiers: glm-5.3, glm-5.3-flash, deepseek-v4-pro, deepseek-v4.1-flash. The current list of models and prices: GET https://api.zukko.pro/v1/models and the "Models" page in the dashboard.
The models and what differs
Zukko prices as of October 18, 2026, $ per 1M tokens. "Strength" is the Intelligence Index (Artificial Analysis).
| Model | Input / output | Context | Image input | Strength |
|---|---|---|---|---|
qwen3.8-max | 0.088 / 0.238 | 1M | yes | 45 |
qwen3.8-flash | 0.038 / 0.075 | 1M | no | 40 |
deepseek-v4-pro | 0.075 / 0.225 | 1M | yes | 36 |
deepseek-v4.1-flash | 0.013 / 0.038 | 1M | no | 39 |
glm-5.3 | 0.1 / 0.1 | 128K | no | 45 |
glm-5.3-flash | 0.04 / 0.04 | 128K | no | 42 |
claude-sonnet-5-5 | 0.4 / 2 | 1M | yes | 48 |
claude-opus-5-5 | 0.8 / 4 | 1M | yes | 58 |
Practical consequences:
- Images. If you paste screenshots into Claude Code, a model without image input ("no" in the table) cannot handle the image, and the request may fail with an error. Among the inexpensive ones,
qwen3.8-maxanddeepseek-v4-protake images. - Context. GLM has a 128K window, the others 1M. For model identifiers outside the
claude-family Claude Code may assume a window size different from the real one; the Claude Code documentation has aCLAUDE_CODE_MAX_CONTEXT_TOKENSvariable, so check the details there. On long sessions with GLM this matters. - Tool calling. Claude Code is built on tool calls (reading files, running commands). How a particular model copes with this in Claude Code, check on a small real task, not from a table.
- Cache. For Qwen, DeepSeek and GLM the cache read price equals the input price (the cache columns in the price list match the input), so caching makes nothing cheaper here. Cache gives a discount on Claude in the Anthropic format: a read costs noticeably less than input.
We do not compare model quality: the strength index figures are a guide, and testing on your own tasks decides.
What a session costs
Take a hypothetical example: a session of 3M input tokens and 0.1M output tokens. For Claude we split the input: 2.7M cache read, 0.15M cache write, 0.15M fresh. For the other models we take all input at the input price, since their cache read price equals the input price.
Formula for models without a separate discount: 3 × input price + 0.1 × output price.
deepseek-v4.1-flash: 3 × 0.013 + 0.1 × 0.038 = 0.039 + 0.0038 = $0.043.qwen3.8-flash: 3 × 0.038 + 0.1 × 0.075 = 0.114 + 0.0075 = $0.122.glm-5.3-flash: 3 × 0.04 + 0.1 × 0.04 = 0.12 + 0.004 = $0.124.deepseek-v4-pro: 3 × 0.075 + 0.1 × 0.225 = 0.225 + 0.0225 = $0.248.qwen3.8-max: 3 × 0.088 + 0.1 × 0.238 = 0.264 + 0.0238 = $0.288.glm-5.3: 3 × 0.1 + 0.1 × 0.1 = 0.3 + 0.01 = $0.31.
For Claude, by the formula "fresh input × input + read × read price + write × write price + output × output price":
claude-sonnet-5-5: 0.15 × 0.4 + 2.7 × 0.05 + 0.15 × 0.5 + 0.1 × 2 = 0.06 + 0.135 + 0.075 + 0.2 = $0.47.claude-opus-5-5: 0.15 × 0.8 + 2.7 × 0.08 + 0.15 × 1 + 0.1 × 4 = 0.12 + 0.216 + 0.15 + 0.4 = $0.886.
What this shows. The cheapest options (DeepSeek V4.1 Flash, Qwen and GLM Flash) cost $0.04 to $0.12 against $0.47 for Sonnet 5.5 with cache, while the mid-range options (qwen3.8-max, glm-5.3, deepseek-v4-pro) are closer to it: $0.25 to $0.31 against $0.47. Had Sonnet 5.5 been counted without cache, the same volume would cost 3 × 0.4 + 0.1 × 2 = $1.4, but Claude Code works in the Anthropic format and uses cache. So the saving is most visible when moving to the "flash" models, while for the Max-class ones the gap to cached Claude is smaller. The token split in the example is illustrative; see your own in the "Usage" section. A detailed session calculation with cache: what a Claude Code agent costs.
How to keep the expensive model for hard work
There are two working approaches.
- Manual switching. A cheap model is the main one, and on a hard task you type
/model opus, and the Opus slot sends requests toclaude-opus-5-5. After the task you switch back. A simple and clear scheme. - Planning mode. Claude Code can use the Opus slot for planning and the Sonnet slot for execution (the
opusplanmode; check the name in the documentation for your version). Then you put a cheap model in the Sonnet slot and a strong one in the Opus slot.
Subagents can also be sent to a cheap model so that reconnaissance of the project does not spend expensive tokens: a subagent's model is set in its configuration; see the Claude Code documentation for details.
How to check that everything works
- Run
claudeand give a simple task: "show the project structure and find the settings file". - Make sure the agent calls tools (reads files, runs commands) and not only writes text. If it answers "I have no access to files", see the analysis the agent does not see files.
- In the "Usage" section of the dashboard check that requests go to the right model and the cost matches expectations.
- If you get 404
model_not_found, check the identifier spelling againstGET /v1/models; 403model_not_allowed_for_keymeans the model is not on the key's list.
To keep spend under control, create a separate key with a daily limit. Comparing the cheap lines: Qwen versus GLM.
FAQ
Can I run Claude Code on Qwen?
Yes: set ANTHROPIC_BASE_URL=https://api.zukko.pro, the key in ANTHROPIC_AUTH_TOKEN and ANTHROPIC_MODEL=qwen3.8-max. The gateway accepts any catalogue model in the Anthropic format.
What about the Fable slot?
If you use Claude Fable 5.1 (claude-fable-5-1, $7 / $35 per 1M as of October 18, 2026), the Claude Code documentation lets you pin it to the fable alias with ANTHROPIC_DEFAULT_FABLE_MODEL or select it with /model claude-fable-5-1. We do not use it in the examples of this article because of its price.
How do I keep Opus for hard tasks?
Put claude-opus-5-5 into ANTHROPIC_DEFAULT_OPUS_MODEL and switch with /model opus for as long as needed. Keep a cheap model as the main one.
How do I pay from Russia?
Access goes through a gateway: SBP (the payment page adds an 8.5% fee on top), MasterCard or cryptocurrency. There is no subscription, you pay for tokens.
To try it, create a key in the Zukko dashboard, set the variables from this article and run claude on a small task.
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
- How much Cline costs: the extension is free, you pay for tokens — a calculationWith your own key Cline sells no model subscription: you pay for tokens. A workday on several models, calculated, and how to stay within budget.
- opencode agents: setting up roles, models and toolsA custom agent in opencode is a role, a model and a set of permissions. A working config where a cheap model handles routine work and a stronger one edits code.
- Plan mode in Claude Code: plan first, then edit the codeIn plan mode Claude Code reads your code and proposes a plan but edits nothing until you agree. How to enable it, use it and what it costs.
- JetBrains AI Assistant not working: causes and workaroundsAI Assistant will not activate, stays silent or is off for some files. We go through the causes in the JetBrains docs and connect your own models via a gateway.