Qwen Code is an open-source AI coding agent that can inspect repositories, edit files, execute commands, and connect to different AI model providers.
But there's a question that often causes confusion:
Is Qwen Code actually free, or do you need to pay for an API key?
The short answer: the client is free, but the AI models you connect to it may not be.
And if you're following an older tutorial that recommends signing in with Qwen OAuth for free usage, that advice is now outdated.
Here's how Qwen Code works in 2026 and how to set it up without choosing the wrong authentication or billing method.
1. What is free, and what costs money?
Qwen Code itself is an open-source application licensed under Apache 2.0.
You can install the client without purchasing a software license. However, the client still needs access to an AI model.
There are several ways to provide that access:
| Connection | How billing generally works |
|---|---|
| QwenCloud Token Plan | Subscription with a monthly credit quota |
| QwenCloud Standard API Key | Pay-as-you-go API usage |
| Alibaba ModelStudio Coding Plan | Subscription with an included usage quota |
| Alibaba ModelStudio Token Plan | Usage-based billing through a dedicated endpoint |
| Alibaba ModelStudio Standard API Key | Pay-as-you-go API usage |
| Third-party model provider | Depends on that provider's pricing |
| Self-hosted local model | No hosted inference charge, but requires your own hardware |
This distinction matters.
Installing a free coding agent does not automatically give you unlimited free access to the models it uses.
Also, QwenCloud Token Plan and Alibaba ModelStudio Token Plan are separate offerings. Do not assume that a key or subscription for one automatically works with the other.
2. Install Qwen Code
For an npm installation, first check that you have Node.js 22 or later.
node --version
Then install Qwen Code:
npm install -g @qwen-code/qwen-code@latest
On macOS or Linux, Homebrew is another documented installation option:
brew install qwen-code
Navigate to a project directory and launch the client:
cd your-project
qwen
The first launch will guide you through provider authentication.
Official installation guide: Qwen Code Quickstart.
3. Choose the right authentication method
Inside the running Qwen Code interface, enter:
/auth
You'll be able to choose from supported connection types.
Option A: QwenCloud
This is a straightforward option if you want to use QwenCloud directly.
You can choose between:
- Token Plan: a subscription with a monthly credit quota.
- Standard API Key: pay for API usage based on the provider's pricing.
Select the correct regional platform and enter the key issued for that service.
Option B: Alibaba ModelStudio
Alibaba ModelStudio provides several choices, including Coding Plan, Token Plan, and Standard API Key.
These offerings differ in their intended users, quotas, billing rules, and endpoints.
For example, Coding Plan is oriented toward individual developers with an included usage quota. Token Plan uses a separate usage-based endpoint.
Choose the specific offering that matches your account and API key.
Option C: Third-party providers
Qwen Code can also connect to supported third-party model providers.
This can make sense if you already have an API account elsewhere or want more flexibility over which model you use.
You should verify the provider's supported models, usage terms, and pricing before connecting.
Option D: Custom or local provider
Qwen Code supports custom model connections, including compatible locally hosted model servers.
For example, a local inference server exposing an OpenAI-compatible endpoint may be configured as a model provider.
This can avoid hosted-model API charges, but it doesn't guarantee every tool or feature works entirely offline.
4. Important: the old free Qwen OAuth option is gone
This is one of the biggest changes to watch out for.
The previous Qwen OAuth free tier was discontinued on April 15, 2026.
As a result, some older installation videos and blog posts may describe a sign-in path that is no longer available for normal use.
If an old tutorial tells you to rely on free Qwen OAuth access, check the current official documentation instead.
The current recommended workflow is to launch qwen and configure an available provider through /auth.
Also note that the old standalone qwen auth CLI command has been removed in the current documentation. The interactive /auth command is entered inside Qwen Code, not directly in your shell.
Official reference: Qwen Code Authentication.
5. Check your connection and select a model
Once authentication is complete, you can use these commands inside Qwen Code:
/doctor
Check your environment and authentication configuration.
/model
Choose from the models available through your configured providers.
/help
Show the currently available commands.
Before running an expensive repository-wide task, try a small request first.
For example:
Inspect this repository and explain its main modules. Do not modify any files.
Then verify that the selected model responds correctly and that the provider's usage is being recorded as expected.
Never commit your API keys to a Git repository.
6. Which setup should you choose?
Here's a practical way to decide:
You already pay for an API provider: Check whether Qwen Code supports that provider and whether your existing credentials are eligible.
You want predictable usage within an included quota: Compare the current subscription and quota terms of the relevant QwenCloud or Alibaba ModelStudio plan.
You prefer usage-based billing: Choose an appropriate Standard API Key or usage-based provider connection.
You want to run models locally: Check your available hardware, local inference server, model compatibility, and offline requirements.
There isn't one universally cheapest option. The total cost depends on the model, workload, quota, cache behavior, and provider terms.
7. A final recommendation
Before committing to a paid plan, do three things:
- Confirm that your intended model is supported by your chosen provider.
- Run a small real coding task and inspect the result.
- Check the provider's billing dashboard or quota usage.
A free client is useful, but the right model connection determines much of the actual experience and cost.
For a source-backed overview of Qwen Code, including its model and API relationships, I've also put together a reference page on iilib — Qwen Code.
Official references
Documentation reviewed: November 2026. Model availability, authentication options and pricing may change.
Which provider are you using with Qwen Code, and what has your setup experience been like?
Top comments (0)