Qwen Code guide: install, sign-in options after the free tier ended, and features
Qwen Code is the Qwen team's terminal agent. Alibaba released it in mid-2025 alongside its Qwen3-Coder models, as a fork of Google's open-source Gemini CLI. The team adapted the prompts and tool-call parsing for Qwen models and added its own sign-in options. For most of its first year, the main draw was a free tier: sign in with a Qwen account and get up to 1,000 requests a day at no cost.
That tier is gone. On April 13, 2026, the Qwen team cut the free quota to 100 requests a day. Two days later, on April 15, it discontinued Qwen OAuth free access entirely, as announced in the project's GitHub issue #3203. Qwen Code still works, and is still free software, but you now need a paid plan or another provider for the models.
Installing Qwen Code
| Method | Command |
|---|---|
| npm | npm install -g @qwen-code/qwen-code@latest |
| Homebrew | brew install qwen-code |
| Standalone | Install script from the project README |
The npm package needs Node.js 22 or later. Start it with qwen inside a project.
Signing in after the free tier
Run /auth to choose how Qwen Code reaches a model:
| Option | How you pay | Notes |
|---|---|---|
| QwenCloud | Token Plan or API key | Direct access to Qwen models from the Qwen team |
| Alibaba Cloud Model Studio | Coding Plan subscription or pay per token | Weekly quota on the Coding Plan, regional pricing |
| Third-party providers | That provider's rates | DeepSeek, OpenRouter and other OpenAI-compatible APIs |
| Custom provider | Your own endpoint | Local servers such as Ollama or vLLM, or a company gateway |
Settings live in ~/.qwen/settings.json, and you can also pass an API key, base URL and model through environment variables. /doctor checks your setup and reports common problems, such as a missing key or an unreachable endpoint.
If you used Qwen Code on the free tier and it stopped working in April 2026, that is why. Run /auth and choose one of the options above.
Moving off the free tier, step by step
If your setup broke when Qwen OAuth ended, these steps get you running again:
- Update first with
npm install -g @qwen-code/qwen-code@latest, since newer versions list the current sign-in options and give clearer error messages. - Decide how you want to pay. A QwenCloud API key suits light, irregular use, because you pay only for tokens. A Coding Plan suits daily use, because the weekly quota costs a fixed amount. A third-party provider suits you if you already have credit there or want to compare models.
- Run
qwen, then/auth, and pick the matching option. Paste the key or sign in. - Run
/doctorto confirm the endpoint and model respond. - Set a spending limit or alert in the provider's console. Agents can use many tokens in one long task, and a mistake in a loop is cheaper to catch early.
Teams that standardized on Qwen Code for its free tier should also check whether their new provider's data terms fit their policies, since the provider now receives the code the agent reads.
Choosing a Qwen model
Qwen publishes several coding models, with open weights for most of them. Larger models handle multi-file changes and long agent loops better. Smaller ones are faster and cheaper and work for quick edits, explanations and tests. If you self-host, the model size decides the hardware: the largest Qwen coding models need data center GPUs, while smaller ones run on a workstation or a Mac with plenty of memory through Ollama or vLLM. Check the Qwen blog for current model names, since the lineup changes several times a year.
How it works
Because Qwen Code inherits Gemini CLI's design, its workflow will feel familiar. You type a task, and the agent searches the project, reads files, proposes edits, runs shell commands and checks the output. File writes and commands wait for approval unless you allow them in settings or switch to a mode that accepts edits automatically.
It reads a project context file with standing instructions, and you can add MCP servers in settings to connect databases, issue trackers and other services. A non-interactive mode, qwen -p "task", runs one prompt and prints the result for scripts and CI.
What Qwen Code adds to the Gemini CLI base
- Prompts and parsing for Qwen models. The agent's instructions and tool-call handling are tuned for Qwen3-Coder and later Qwen coding models, which use their own formats.
- Authentication choices. QwenCloud, Model Studio and any OpenAI-compatible endpoint, instead of Google accounts.
- Diagnostics.
/doctorfor checking configuration. - Its own release cycle. The fork has drifted from Gemini CLI since 2025 and gains features independently. Check the Qwen Code changelog rather than Gemini CLI's when looking for a feature.
Where Qwen Code works well
- Developers who want Qwen's coding models with an agent built around them.
- Teams in regions where Alibaba Cloud is the main provider, or that already buy Model Studio services.
- Cost-sensitive work, since Qwen and other open-weight coding models are often priced well below frontier Western models.
- Self-hosted setups. Qwen's coding models are released with open weights, so you can run them on your own servers and point Qwen Code at them.
Limits and risks
Free access ended abruptly. The free tier went from 1,000 requests a day to nothing within a week. Plan for paid access, or keep a second agent configured.
Regional differences. Alibaba Cloud's international and China sites sell different plans with different prices and terms. Read the terms for the region your account belongs to, including where your data is processed.
Tuned for Qwen. Other models work through OpenAI-compatible endpoints, but you may get better results from a provider-neutral agent such as OpenCode or Aider when using non-Qwen models.
Commands run on your machine. As with every terminal agent, keep approvals on for destructive commands, work on a branch, and use a container for unattended runs.
Qwen Code compared with other terminal agents
| Tool | Default models | License | Cost to start |
|---|---|---|---|
| Qwen Code | Qwen | Apache 2.0 | QwenCloud or Model Studio plan |
| Gemini CLI | Gemini | Apache 2.0 | Paid Gemini API or Code Assist |
| Codex CLI | OpenAI | Apache 2.0 | ChatGPT Free |
| Claude Code | Claude | Proprietary | Claude Pro, $20/month |
| OpenCode | Any of 75+ providers | MIT | Free tool, pay for model |
Choose Qwen Code if you want Qwen models with an agent tuned for them, especially through Alibaba Cloud. If you want the cheapest way to start, Codex CLI on a free ChatGPT account is the main remaining option from a large lab. To run Qwen models locally, use Ollama. See the terminal tools guide for every option.
Frequently asked questions
Is Qwen Code still free?
The software is free and open source. The free model access is gone. Qwen OAuth used to give 1,000 free requests a day, then dropped to 100 a day on April 13, 2026, and the Qwen team discontinued it on April 15, 2026. To use Qwen Code now, connect a paid QwenCloud plan or API key, an Alibaba Cloud Model Studio Coding Plan, or a third-party provider. Some providers, such as OpenRouter, list free Qwen models with tight rate limits.
How do I install Qwen Code?
With Node.js 22 or later, run npm install -g @qwen-code/qwen-code@latest. On macOS or Linux you can also use brew install qwen-code, and the project publishes a standalone install script. Then run qwen inside a project folder. On first launch, choose an authentication method with /auth.
What is the Coding Plan?
The Coding Plan is a subscription sold through Alibaba Cloud Model Studio for using Qwen's coding models in tools such as Qwen Code, Claude Code and others that accept an Anthropic- or OpenAI-compatible endpoint. It has a usage quota that resets weekly. Prices and quotas differ between Alibaba Cloud's international and China regions, so check the Model Studio pricing page for your account.
Can Qwen Code use models other than Qwen?
Yes. Qwen Code accepts any OpenAI-compatible provider. You can point it at DeepSeek, OpenRouter, a local server such as Ollama or vLLM, or a custom endpoint, by setting the base URL, API key and model in /auth or in ~/.qwen/settings.json. The prompts and tool behavior are tuned for Qwen models, so results with other models can vary.
How is Qwen Code different from Gemini CLI?
Qwen Code started as a fork of Gemini CLI, so the interface, commands and many features look alike. Alibaba's team changed the parser and prompts to suit Qwen's coding models, added its own authentication options and has since added features of its own. Gemini CLI is built for Google's Gemini models and accounts. Both are Apache 2.0 licensed.