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:

VariableWhat it controls
ANTHROPIC_MODELthe default session model
ANTHROPIC_DEFAULT_OPUS_MODELwhat the opus alias turns into
ANTHROPIC_DEFAULT_SONNET_MODELthe sonnet alias
ANTHROPIC_DEFAULT_HAIKU_MODELthe 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.

bash
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-flash

The same values can go into the env block of ~/.claude/settings.json:

bash
{
  "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).

ModelInput / outputContextImage inputStrength
qwen3.8-max0.088 / 0.2381Myes45
qwen3.8-flash0.038 / 0.0751Mno40
deepseek-v4-pro0.075 / 0.2251Myes36
deepseek-v4.1-flash0.013 / 0.0381Mno39
glm-5.30.1 / 0.1128Kno45
glm-5.3-flash0.04 / 0.04128Kno42
claude-sonnet-5-50.4 / 21Myes48
claude-opus-5-50.8 / 41Myes58

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-max and deepseek-v4-pro take 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 a CLAUDE_CODE_MAX_CONTEXT_TOKENS variable, 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.

  1. Manual switching. A cheap model is the main one, and on a hard task you type /model opus, and the Opus slot sends requests to claude-opus-5-5. After the task you switch back. A simple and clear scheme.
  2. Planning mode. Claude Code can use the Opus slot for planning and the Sonnet slot for execution (the opusplan mode; 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

  1. Run claude and give a simple task: "show the project structure and find the settings file".
  2. 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.
  3. In the "Usage" section of the dashboard check that requests go to the right model and the cost matches expectations.
  4. If you get 404 model_not_found, check the identifier spelling against GET /v1/models; 403 model_not_allowed_for_key means 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.

Get API keyDocumentation

api.zukko.pro · fetch_*

Claude Code with Qwen API: running on cheap models · Zukko