Skip to content

Qwen3-Coder + Codex CLI: Setup Guide on WSL

Use Qwen3-Coder with Codex CLI inside WSL on Windows. DashScope config.toml provider, wire_api, big-context coding, pricing and coding plan, and fixes.

MGMCSA Guru Team June 25, 2026 3 min read
Codex CLI in WSL configured for Qwen3-Coder via DashScope on Windows

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_KEY not exported.
  • “Model not found” — confirm qwen3-coder-plus is current on Model Studio.
  • Changes ignored — restart Codex; config.toml loads 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.

Frequently asked questions

Can Codex CLI use Qwen3-Coder?

Yes. Alibaba's DashScope is OpenAI-compatible, so you add it as a custom provider in Codex's config.toml with wire_api set to chat, then point the model at qwen3-coder-plus. It runs the same as any OpenAI-style provider.

What base URL does Codex use for Qwen?

The international OpenAI-compatible endpoint https://dashscope-intl.aliyuncs.com/compatible-mode/v1. Set it as base_url in the DashScope provider block.

Why run this in WSL?

WSL gives a standard Linux shell where Codex, environment variables, and big-context sessions behave predictably. On Windows it avoids env-var and PATH quirks, which is why many Codex users prefer it.

Does Qwen have a coding plan?

Yes — Alibaba's Coding Plan is roughly $50/month for about 90,000 requests and includes select third-party models, alongside pay-per-token billing. Heavy users save with the plan.

Which model ID do I use?

qwen3-coder-plus for agentic coding. Confirm the current ID on Model Studio, since names update with releases, and set it as the model in config.toml.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.