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+):

bash
npm install -g @qwen-code/qwen-code@latest

On 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:

bash
export OPENAI_API_KEY="fetch_..."
export OPENAI_BASE_URL="https://api.zukko.pro/v1"
export OPENAI_MODEL="claude-sonnet-5"
  • OPENAI_API_KEY — your fetch_... 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 /v1 suffix.
  • OPENAI_MODEL — a model id from the Zukko catalog.

Quick start

macOS / Linux:

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

Windows (PowerShell):

bash
$env:OPENAI_API_KEY = "fetch_..."
$env:OPENAI_BASE_URL = "https://api.zukko.pro/v1"
$env:OPENAI_MODEL = "claude-sonnet-5"
qwen

Ask any question, then open Usage in your dashboard — the request should appear there.

Models and prices

ModelOPENAI_MODELZukko price in/out per 1MContext
Claude Sonnet 5claude-sonnet-5$0.30 / $0.301M
Claude Opus 5.5claude-opus-5-5$0.30 / $0.301M
GPT-5.6 Solgpt-5.6-sol$0.30 / $0.301M
GPT-5.6 Lunagpt-5.6-luna$0.10 / $0.101M
GLM 5.3glm-5.3$0.10 / $0.10128K
GLM 5.3 Flashglm-5.3-flash$0.04 / $0.04128K

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:

bash
{
  "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; id is sent to the API, name is 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/.env file or an export in your shell profile for secrets.
  • security.auth.selectedType — which protocol to use at startup, so you don't have to go through /auth manually.
  • model.name — the default model; it must match one of the id values.

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:

bash
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

  1. Did you run export in the same terminal where you start qwen? Variables don't carry over between windows.
  2. For persistent use, add them to ~/.bashrc / ~/.zshrc or use settings.json.
  3. Check the current auth with /doctor inside 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.

Get API keyDocumentation

api.zukko.pro · fetch_*

Qwen Code CLI: use other models via the Zukko OpenAI API · Zukko