Qwen Code is Qwen’s open-source terminal coding agent. Current releases can use qwen3.8-max, Alibaba’s production flagship, through Model Studio. The CLI can read a repository, edit files, and run commands, so start it in a project where you can review or revert changes.
This covers installing and first-running Qwen Code on Windows, getting it talking to DashScope, and the pricing choices. If you’d rather use Qwen through a different agent, see run Qwen3-Coder with Claude Code.
Step 1: Node
Qwen Code is a Node package, so install Node first. Native Windows and WSL both work. See the WSL install guide if the project already uses Linux tooling.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
Step 2: Install Qwen Code
Install it globally with npm (check the project’s current package name in Alibaba’s docs):
npm install -g @qwen-code/qwen-code@latest
Confirm it’s available:
qwen --version
Step 3: API key from DashScope
Create an Alibaba Cloud Model Studio account and generate a DashScope API key. Set it as the environment variable Qwen Code expects (its docs name the exact variable), and use the international endpoint outside mainland China:
export DASHSCOPE_API_KEY="sk-your-key"
Step 4: First run
Point Qwen Code at qwen3.8-max and start it in a project folder:
cd ~/myproject
qwen
Give it a small first task such as “summarize this repo and list the entry points”. Confirm that it reads files before allowing edits or commands.
Models
Qwen models worth using
| qwen3.8-max | Current flagship; coding, tools, vision, and 1M context |
|---|---|
| qwen3.7-plus | Lower-cost hosted model for routine work |
| Qwen3.8-27B | Open model for local or self-hosted use |
For a new hosted configuration, start with qwen3.8-max. Use the exact ID shown by your provider because local and third-party deployments often use a different name.
Pricing and coding plan
- Pay-per-token on DashScope, with a cache-hit discount on repeated input.
- Alibaba’s current Token Plan is credits-based. Check the live plan page for seat prices and credit multipliers.
See Alibaba Coding Plan vs pay-per-token to choose. Verify current quotas and rates on Model Studio, as they change.
Troubleshooting
- If
qwenis not found, reopen the shell and check npm’s global binary path. - For authentication failures, check the region endpoint and API key variable.
- If the model is not found, confirm that
qwen3.8-maxis available in the selected workspace and region. - If file operations are slow in WSL, keep the project in the Linux file system instead of
/mnt/c.
Qwen Code CLI checklist
- Node installed (nvm in WSL recommended)
- Qwen Code installed globally with npm
- DashScope API key set for the right region
- Model set to qwen3.8-max
- First task run in a project folder
Verify the installation
Run qwen --version, start the CLI in a small repository, and ask it to explain one file without making edits. Once authentication and model selection work, approve a small change and inspect the diff.
To use Qwen elsewhere, see Qwen3-Coder with Codex CLI or use Qwen with Aider.