Qwen Code works with five backends: pick the one that bills you

By Christophe Paka · Facts checked on 7 November 2026

You use a paid coding agent every day, and the bills keep growing. So you try Qwen as the cheaper engine. An old guide says Qwen Code is free with a Qwen account. You install it, sign in, and the free path is not there.

The guide is out of date, and the tool is not the part that costs money. Qwen Code is free and open source. The model behind it is what bills you, unless it runs on your own machine. The figure shows the five kinds of backend the tool can call, so you can pick the one that fits how you want to pay.

Qwen Code, a terminal CLI, sits in the centre. Arrows reach it from five backends: the OpenAI, Anthropic, Gemini and Qwen APIs, and a local model through Ollama or vLLM. You switch the backend with /auth.
Figure 7.1: One coding tool, five backends. The tool is not tied to one model; switch the backend with /auth.
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Start at the box in the middle. This is Qwen Code, Alibaba's coding tool for the terminal. It is open source under Apache 2.0, so anyone may read and change its code. No terminal? It also ships a desktop app that works with clicks, and it runs inside the VS Code, JetBrains and Zed code editors.

  2. Read the three boxes at the top. The OpenAI, Anthropic and Gemini APIs are other companies' models. A backend is the model service behind the tool. With one of these, you bring that company's key and pay its prices. Qwen Code is not tied to Qwen models.

  3. Read the coloured box at the bottom right. The Qwen API is Alibaba's own model service, so your code goes to Alibaba and is stored in the region you call. The box names Qwen3-Coder-480B-A35B, the open coding model: 480B parameters stored, 35B used for each token. Most readers code with the general Qwen models instead: the 27B on their own machine, or Flash and Max hosted.

  4. Read the box at the bottom left. A local model runs on your own machine through Ollama or vLLM, two free programs that load a model and answer requests. Nothing is billed per request, and no model service gets your code. Check first that the model fits your card, as will it fit on your card shows.

  5. Read the note at the bottom. You switch the backend with the /auth command, at any time. Inside /auth you pick a path: the account that bills you. Two paths can reach the same backend and still send different bills. QwenCloud bills a Token Plan or pay as you go; Alibaba ModelStudio adds the Coding Plan.

Key takeaways

  • Run /auth first, and pick the path by how you want to pay, not by the model name.
  • Treat any guide that promises free Qwen Code through a Qwen account as out of date.
  • If your graphics card holds the 27B, use the custom provider path: nothing is billed per request.

Try this: set up Qwen Code and send one test request

You need a terminal and Node 22 or newer for the npm install; npm is Node's tool that installs software with one command. You also need a QwenCloud key, a plan, or a local model already running.

  1. Make an empty folder and open your terminal inside it. The agent can change everything in that folder, so keep nothing else there.
  2. Install the tool with npm install -g @qwen-code/qwen-code, then run qwen --version. You should see a version number.
  3. Run qwen, type /auth and pick a path. For QwenCloud, pick the international platform entry and paste a key from the region you will call.
  4. Leave the session and run qwen -p "Hello". This headless mode prints one answer and exits.

Expected result: A short greeting, then your prompt again. An error here means /auth did not save a working path. An authentication error with a new key means the key and the region do not match: a key works only in the region that issued it.

Questions readers ask

Is Qwen Code still free?

The tool is free and open source. The model behind it is not, unless it runs on your machine. The Qwen OAuth free tier was discontinued on 2026-04-15. Since then you pay through a plan, pay per use, or run the model yourself.

Qwen Code vs Claude Code: which should I use?

Already on Claude Code? Keep it, and point it at Qwen through QwenCloud's Anthropic compatible address. You set three values: the key, the address and the model id. Starting fresh? Use Qwen Code, whose instructions are tuned for Qwen models.

Which /auth path costs the least?

If your card holds the 27B, the custom provider path costs nothing per request. The Token Plan and the Coding Plan suit a person typing into the tool, not scripts, and neither can be refunded. Already paying as you go on QwenCloud? Start there and watch the bill for a week. The book has no cost per coding task to compare them.

Does Qwen Code send my code to Alibaba?

Your code goes to the backend you pick: Alibaba for the Qwen API, your own machine for a local model. On Model Studio, Alibaba says it never trains on your data but does not say how long it keeps it; QwenCloud's pages say neither. Whether the tool itself sends usage data, the book's sources do not say.

Sources: QwenLM/qwen-code on GitHub; Qwen Code docs: Authentication; QwenCloud docs: Qwen Code.

This figure is from Qwen Made Crystal Clear, chapter 7.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams