Qwen Code CLI with Claude, GPT, and GLM via Zukko
Qwen Code isn't limited to Qwen models: it supports OpenAI-compatible APIs, so through Zukko you can use Claude, GPT, and GLM in it.
4 min · · IDE · development
Qwen Code is a terminal coding agent from the Qwen team, but it isn't limited to Qwen models. It supports OpenAI-compatible APIs, which means that through Zukko you can use Claude, GPT, and GLM in it with one fetch_... key. Below: a quick connection via environment variables, a persistent setup via settings.json, and troubleshooting.
What Qwen Code is
Qwen Code is an open-source coding agent: it reads and edits code in your project, runs commands, and integrates with VS Code, Zed, and JetBrains. According to the project README, it supports several protocols — OpenAI, Anthropic, Gemini — and any third-party provider. For Zukko, the OpenAI-compatible option is the simplest.
Installation (requires Node.js 22+):
npm install -g @qwen-code/qwen-code@latestOn macOS and Linux you can also use Homebrew: brew install qwen-code. Start the agent with qwen in your project folder.
Environment variables for the connection
According to the Qwen Code docs, the OpenAI-compatible protocol uses three variables:
export OPENAI_API_KEY="fetch_..."
export OPENAI_BASE_URL="https://api.zukko.pro/v1"
export OPENAI_MODEL="claude-sonnet-5"OPENAI_API_KEY— yourfetch_...key from the API keys page. This is the variable that enables OpenAI-compatible auth without interactive setup.OPENAI_BASE_URL— the Zukko address with the/v1suffix.OPENAI_MODEL— a model id from the Zukko catalog.
Quick start
macOS / Linux:
export OPENAI_API_KEY="fetch_..."
export OPENAI_BASE_URL="https://api.zukko.pro/v1"
export OPENAI_MODEL="claude-sonnet-5"
cd /path/to/your-project
qwenWindows (PowerShell):
$env:OPENAI_API_KEY = "fetch_..."
$env:OPENAI_BASE_URL = "https://api.zukko.pro/v1"
$env:OPENAI_MODEL = "claude-sonnet-5"
qwenAsk any question, then open Usage in your dashboard — the request should appear there.
Models and prices
| Model | OPENAI_MODEL | Zukko price in/out per 1M | Context |
|---|---|---|---|
| Claude Sonnet 5 | claude-sonnet-5 | $0.30 / $0.30 | 1M |
| Claude Opus 5.5 | claude-opus-5-5 | $0.30 / $0.30 | 1M |
| GPT-5.6 Sol | gpt-5.6-sol | $0.30 / $0.30 | 1M |
| GPT-5.6 Luna | gpt-5.6-luna | $0.10 / $0.10 | 1M |
| GLM 5.3 | glm-5.3 | $0.10 / $0.10 | 128K |
| GLM 5.3 Flash | glm-5.3-flash | $0.04 / $0.04 | 128K |
For the current list, use GET https://api.zukko.pro/v1/models or the Models page in your dashboard. Which model handles your code better can't be known in advance: give the same task to two or three models and compare the results and the spend.
You can also set the model at launch without changing variables: qwen --model "gpt-5.6-sol".
Persistent setup via settings.json
Typing variables every time is inconvenient. The Qwen Code docs recommend describing the provider in ~/.qwen/settings.json:
{
"modelProviders": {
"openai": [
{
"id": "claude-sonnet-5",
"name": "Claude Sonnet 5 (Zukko)",
"baseUrl": "https://api.zukko.pro/v1",
"envKey": "ZUKKO_API_KEY"
},
{
"id": "gpt-5.6-sol",
"name": "GPT-5.6 Sol (Zukko)",
"baseUrl": "https://api.zukko.pro/v1",
"envKey": "ZUKKO_API_KEY"What's going on here:
modelProviders.openai— the model list for the OpenAI-compatible protocol;idis sent to the API,nameis shown in the menu.envKey— the name of the variable holding the key. A custom name,ZUKKO_API_KEY, keeps it separate from other providers.env— a fallback way to store the key right in the file (lowest priority). The key sits there in plain text, so the Qwen Code docs suggest a.qwen/.envfile or anexportin your shell profile for secrets.security.auth.selectedType— which protocol to use at startup, so you don't have to go through/authmanually.model.name— the default model; it must match one of theidvalues.
After that, just run qwen, and switch models with /model right in the session.
Qwen models and Zukko
Qwen-family models are not in the Zukko catalog right now. If you specifically need Qwen, connect Qwen Code to Alibaba Cloud following its instructions. Through Zukko, Qwen Code works with the Claude, GPT, and GLM models in the table above.
Troubleshooting
401 unauthorized
The key is mistyped, revoked, or copied with spaces. Check it on the API keys page.
402
Your balance has run out. Top up and retry.
Model not found (404)
A typo in the model id, or the model isn't in the catalog. Check the list:
curl https://api.zukko.pro/v1/models \
-H "Authorization: Bearer fetch_..."Requests go to the wrong place or return 404 for every model
Make sure the base URL is exactly https://api.zukko.pro/v1, with /v1. The suffix is required for the OpenAI-compatible format.
Qwen Code doesn't see the variables
- Did you run
exportin the same terminal where you startqwen? Variables don't carry over between windows. - For persistent use, add them to
~/.bashrc/~/.zshrcor usesettings.json. - Check the current auth with
/doctorinside Qwen Code.
FAQ
Can I switch models during a session?
Yes. /model lists every model from modelProviders and switches between them; your choice persists across sessions. Without settings.json, restart qwen with a different OPENAI_MODEL or the --model flag.
Which model is best for code?
There's no ready answer; it depends on your tasks. Compare for yourself: the same task on claude-sonnet-5, gpt-5.6-sol, and glm-5.3-flash, then evaluate the result and check the spend in the dashboard. Keep in mind that GLM has a 128K context, while Claude and GPT have 1M.
Is there a caching discount?
Vendors charge around 10% of the input price for prompt-cache reads, while Zukko bills cached tokens at the regular input price. The agent sends a large, repeated context, so for long sessions the real difference from the official price list is smaller than a direct price comparison suggests. Set a daily limit on your key.
Why do different models cost the same?
That's how Zukko pricing works: Claude Sonnet 5, Claude Opus 5.5, and GPT-5.6 Sol cost $0.30 per 1M input and output tokens, GPT-5.6 Luna and GLM 5.3 cost $0.10, and GLM 5.3 Flash costs $0.04. Choose based on results on your own tasks, not just price.
More about API formats is in Anthropic or OpenAI in the Zukko docs.
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
- A neural network for Lua and Roblox: writing Luau scripts with AIWithout guidance a model may confuse Lua with Luau and suggest outdated Roblox APIs. How to phrase the task, check the code and connect an agent to your project.
- How to connect Qwen to VS Code: Companion, Cline and ContinueTwo ways to get Qwen in your editor: the official Companion for Qwen Code, or the Cline, Kilo Code and Continue extensions with an OpenAI-compatible key.
- Claude Code in JetBrains: IntelliJ IDEA and PyCharm on Your Own KeyThe plugin does not bundle Claude Code. It launches the console agent in the IDE terminal. Install, gateway key, diffs and common failures explained.
- Cursor for 1C: writing BSL code with an AI agentHow to open a 1C configuration dump in Cursor, write rules for BSL, give the agent metadata and avoid accepting invented code. With a session cost estimate.