Qwen3-Coder pairs well with Codex CLI: both are fast, both handle big context, and Alibaba’s DashScope is OpenAI-compatible, which is exactly what Codex wants. On Windows, doing this inside WSL gives you the clean Linux shell Codex assumes, so environment variables and large sessions behave predictably.
This is the WSL walkthrough — the config.toml provider, the wire-protocol detail, and the pricing options. For Codex’s general provider model, see Codex CLI custom provider setup.
Step 1: WSL and Codex CLI
If WSL isn’t installed, start with the WSL install guide. Install Codex CLI inside WSL per its docs, then create an Alibaba Cloud Model Studio account and a DashScope API key (use the international endpoint).
Step 2: Add Qwen to config.toml
Codex reads ~/.codex/config.toml. Add a DashScope provider:
model = "qwen3-coder-plus"
model_provider = "dashscope"
[model_providers.dashscope]
name = "Qwen (DashScope)"
base_url = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
env_key = "DASHSCOPE_API_KEY"
wire_api = "chat"
Export the key and run:
export DASHSCOPE_API_KEY="sk-your-key"
codex
Step 3: Use the international endpoint
DashScope endpoints
| dashscope-intl.aliyuncs.com/compatible-mode/v1 | International (Singapore) — use this outside mainland China |
|---|---|
| dashscope.aliyuncs.com/compatible-mode/v1 | Mainland China region |
Pick the region that matches your account; mixing them causes auth failures.
Step 4: Model and big context
qwen3-coder-plus is the agentic coding model, with a very large context window that suits big repos. In WSL, keep your project in the Linux file system so Codex’s file operations stay fast — see access your Windows files from WSL.
Pricing and coding plan
Two options, mixable:
- Pay-per-token on DashScope, with a cache-hit discount on repeated input (often around 75% off the cached portion).
- Alibaba Coding Plan — roughly $50/month for about 90,000 requests, including select third-party models.
Decide by volume — see Alibaba Coding Plan vs pay-per-token. Confirm current numbers on Model Studio, since quotas and rates change.
Troubleshooting
- Format/streaming errors — missing
wire_api = "chat". - Auth errors — wrong region endpoint, or
DASHSCOPE_API_KEYnot exported. - “Model not found” — confirm
qwen3-coder-plusis current on Model Studio. - Changes ignored — restart Codex;
config.tomlloads at startup.
Qwen + Codex (WSL) checklist
- WSL + Codex CLI installed
- DashScope key from Model Studio (intl endpoint)
- [model_providers.dashscope] block with /compatible-mode/v1
- wire_api = "chat" set; model qwen3-coder-plus
- Key in ~/.bashrc; project in Linux home for speed
Wrapping up
Qwen3-Coder with Codex CLI in WSL is a tidy config.toml setup: a [model_providers.dashscope] block on the international /compatible-mode/v1 endpoint, wire_api = "chat", and qwen3-coder-plus. Lean on its big context for large repos, keep the key in your shell profile, and pick pay-per-token or the coding plan by volume.
To run Qwen with other tools, see run Qwen3-Coder with Claude Code and Qwen Code CLI on Windows.