Qwen + Claude Code: the short version
Qwen models are hosted on Alibaba's DashScope platform. DashScope speaks the OpenAI-compatible shape, and also exposes an Anthropic-compatible endpoint aimed at tools like Claude Code. That means you can route Claude Code to Qwen directly by pointing it at the Anthropic-compatible base and supplying your DashScope key.
The config
What to set
- ANTHROPIC_BASE_URLPoint it at Qwen/DashScope's Anthropic-compatible base URL.
- ANTHROPIC_AUTH_TOKENYour DashScope (Alibaba Cloud Model Studio) API key — usage is billed there.
- ModelChoose a Qwen model — the Qwen-Coder line is tuned for coding. Use the exact name the endpoint exposes.
Why route to Qwen
What Qwen brings
| Reason | Detail |
|---|---|
| Cheap | Low per-token cost, competitive for everyday coding |
| Coder-tuned models | The Qwen-Coder line is aimed specifically at code tasks |
| No Claude quota | Route around Claude plan rate limits by using your own DashScope key |
The cleaner option: Qwen as a one-click setting
Rewiring Claude Code's global endpoint works, but you lose the ability to mix models per task. If you want Qwen for routine work and Claude (or DeepSeek, or a local model) for the rest, use an agent where each provider is just a selectable entry — pick Qwen, do the work, switch when you like, no restart.
What that looks like with Wuwei
Qwen in the model list
OpenAI-compatible providers like DashScope/Qwen work as a selectable provider next to Claude, GLM, Kimi and DeepSeek.
Region-aware setup
Set the base URL, key and model once; switch models without touching env vars again.
Free, open source, local
MIT-licensed agent that runs on your machine and reads your real files; you only pay Qwen's usage.
FAQ
Can Claude Code use Qwen?
Yes. Qwen is served via Alibaba's DashScope, which offers an Anthropic-compatible endpoint. Set ANTHROPIC_BASE_URL to that base and ANTHROPIC_AUTH_TOKEN to your DashScope key, then pick a Qwen model.
Which Qwen model is best for coding in Claude Code?
The Qwen-Coder line is tuned for code tasks and is the usual pick for an agent workflow. Use the exact model name your DashScope endpoint exposes.
How do I switch between Qwen and Claude without reconfiguring?
Use an agent where models are settings you pick from a list. Wuwei is free and open source — Qwen and Claude both live in the model list, so switching is one click instead of an env-var edit and restart.