---
title: Qwen Provider (Alibaba DashScope)
---

# Qwen Provider (Alibaba DashScope)

## What it is

Omniscio supports spawning Claude-Code-style sessions backed by **Qwen**'s Anthropic-compatible API — Alibaba's **DashScope** endpoint (hosted at `dashscope-intl.aliyuncs.com/apps/anthropic`) — as an additional provider, alongside `claude` (the default), `codex`, `gemini`, `antigravity`, `deepseek`, `kimi`, `glm`, `minimax`, and `meta`. It is the **sixth** member of the `anthropic-compat` family.

A Qwen session looks identical in the sidebar and main pane to a Claude session — same status dots, same streaming bubbles, same Ctrl+Enter to send, same Plan / Auto-Accept / Bypass Permissions modes, same tool-call approval UI. The provider is invisible in normal chat. The only user-visible difference is the Qwen icon (a violet monogram mark, no text label) in the session header.

Tool-call behavior is **identical to Claude** because the same `claude` CLI binary is doing the talking — only the model and the upstream endpoint differ. There is **no yolo / auto-approve mode** like Gemini or Anti-Gravity; the standard Claude approval flow applies.

## Where to find it

Everything you configure for Qwen lives in **Settings → Accounts** — but only once the **Show alternative AI providers** master toggle is on, which reveals the Qwen panel alongside its siblings. The provider chooser for a single launch sits in the launch-config pickers on a fresh (zero-message) session; the standing per-project default is set from the project's three-dot menu → **Edit** → **Default provider**. Once a Qwen session is running, the only place the provider shows is the Qwen icon in that session's header.

## How it behaves

### How to enable

> **Master toggle required first.** Qwen is an alternative provider — by default Omniscio ships as a Claude-only product, and the entire Qwen setup section below is hidden in Settings → Accounts. Flip **Settings → Accounts → Show alternative AI providers** to ON (off by default) and the Qwen panel appears alongside Gemini, Codex, Anti-Gravity, DeepSeek, Kimi, GLM, MiniMax, and Meta. With the master off, the per-project "Default provider" radio collapses to a single Claude row and the session header's provider switcher (ChangeProviderButton) hides Qwen — Qwen effectively does not exist in the UI even if every gate below is configured. Your saved API key and "Allow Qwen sessions" toggle are preserved across master-toggle flips.

You need the toggle below plus a way to pay for Qwen — your own DashScope API key, Omniscio credits, or both, with Qwen's supply list (**Settings → Accounts → Who pays & who serves**) deciding which pays first (note: no binary check — same `claude` binary as Claude). The opt-in **toggle leads and gates the key field** — the API key input appears only once Qwen is turned on, so a key can't be entered into a disabled provider (when off, a hint keeps the `qwen-api-key` Settings-search anchor landable and a saved key is preserved):

1. **Settings → Account → Allow Qwen sessions in any project** — opt-in toggle, off by default; same security stance as the Codex/Gemini/DeepSeek/Kimi/GLM/MiniMax/Meta spawn guards. Turning it on reveals the key field below.
2. **Settings → Account → Qwen → API key** — paste a DashScope API key from the [Alibaba Cloud Model Studio console](https://www.alibabacloud.com/help/en/model-studio/get-api-key). Encrypted at rest via Electron `safeStorage`. **Optional when Qwen's supply list has an Omniscio credits row** (a new user's list has one) — with no key saved, the session runs on your prepaid credits through the gateway. When both are present, the order of Qwen's list decides which pays first. See [model-vendors.md](model-vendors.md).

> **Qwen needs a credential — your own key or Omniscio credits.** With neither, a Qwen spawn is refused up front with a clear "add a key" message (it never crashes or silently falls back to Claude). Qwen is **not user-key-only**: it rides the same company-credits gateway lane as its Kimi / MiniMax / Meta siblings. When the Omniscio credits row of Qwen's supply list is the row that serves, the child is pointed at Omniscio's gateway instead of DashScope (lane `/v1/qwen`, funded by the pooled OpenRouter key and mapping each Omniscio `qwen/<model>` lane onto OpenRouter's own `openrouter/qwen/<model>` slug) and authenticates with the gateway token rather than a DashScope key. Whichever of the two comes first in Qwen's list pays first, and **either** credential makes the provider spawn-ready. See `FUNDABLE_PROVIDERS` in [fundable-providers.ts](../../src/shared/providers/fundable-providers.ts).

Once both are green, you can launch a Qwen session in three ways:

- **Per-launch override** — on a fresh (zero-message) session, the **ChangeProviderButton** in the new session's main panel (the launch-config pickers on a fresh session) lets you pick a one-off provider before sending the first message. Non-ready providers appear `aria-disabled` with an "Add key…" / "Enable in Settings…" suffix and deep-link to the right Settings panel.
- **Per-project default** — Edit Project dialog (three-dot menu → Edit) has a "Default provider" section listing every enabled provider. Pick Qwen and the project's sidebar "+ New Session" button spawns Qwen automatically.
- **Programmatically** — anything that creates a session with `provider: 'qwen'` (recipes, agent-driven sessions, the CLI control HTTP API). Same readiness gates apply on the backend.

### Choosing the model

A fresh Qwen session lets you pick the model in the launch-config pickers (next to the provider chooser). The list is registry-driven (`MODELS_BY_PROVIDER.qwen` in [provider-models.ts](../../src/shared/providers/provider-models.ts)) and offers five, cheapest first:

- **Qwen3.8 Flash** (`qwen3.8-flash`, the default) — Alibaba's Aug-2026 cheap-fast Flash MoE (early Qwen4 architecture); the low-cost, high-throughput tier.
- **Qwen3.8 Max** (`qwen3.8-max`) — the flagship top-tier model for the hardest agentic reasoning + coding work. This id is a **floating alias** — Alibaba may point it at whichever checkpoint is current.
- **Qwen3.8 Max 0902** (`qwen3.8-max-0902`) — the **pinned 2026-09-02 checkpoint** of that flagship (2.4T-parameter MoE, 1M context), shipped as a coding + agentic refresh. Pick this one when you want a reproducible model that will not shift under you; it bills at the same rates as `qwen3.8-max`.
- **Qwen3.7 Plus** (`qwen3.7-plus`) — the mid tier, and **Alibaba's own recommended model for coding tools** ("balanced performance and cost, with full tool calling and a 1M-token context window for large codebases"; it is also the Coding Plan's default). Note this one is a **3.7** id, deliberately kept for its coding tuning rather than as a newer generation — a middle price point with proven agentic tool use.
- **Qwen3.8 27B** (`qwen3.8-27b`) — the newest **open-weight dense** model (Aug 2026): 1M context, tool calling, and the cheapest genuinely strong coder on the lane. It is the tier that stops the list jumping straight from Flash to Max.

> **On the newest generation.** There is nothing newer than the 3.8 line to offer: **Qwen4 has not shipped** (no Max, Flash or Coder variant exists, and the open-weights `qwen3.8-flash-next` is only a preview of its architecture), and the Qwen3-Coder line's newest entry predates the 3.8 generation. All five ids above are Alibaba-hosted on Model Studio and advertise function calling, so any of them can drive an agentic session.

**Use default** spawns **`qwen3.8-flash`** rather than omitting the model flag — Qwen _requires_ a real Qwen model id (the shared `claude` binary's built-in default is a Claude id that DashScope rejects as "model not found"), so the registry pins one via `getProviderDefaultModel`. Qwen has no separate "reasoning effort" knob in Omniscio. A Qwen session never inherits your Claude default model (those are Claude ids its endpoint would reject).

> **`qwen3.8-flash-next` is intentionally NOT offered.** Qwen's open-weights preview variant (`qwen3.8-flash-next`) is a self-host / download release, not a first-class DashScope-served API id, so it is left out of the picker. Only the five DashScope-served ids above are selectable.

### Per-project default

Each project remembers a default provider in the `projectDefaultProviders` setting (a `Record<projectId, ProviderId>`). Empty by default — every project falls back to Claude. Change it from the project's three-dot menu → Edit → Default provider radios; the change persists immediately.

When you set a project's default to Qwen but Qwen isn't ready (toggle off or key missing), an amber **"!" badge** appears on that project's sidebar row. Hover the badge for a tooltip explaining the gap; click it to deep-link straight to the right Settings panel. The badge re-checks on every render, so fixing the gap clears it without a refresh. Claude defaults never show the badge — Claude is always considered ready.

### Error states and fixes

Two gap codes — fewer than Gemini/Codex because there is no separate binary to check:

| Gap           | What it means                            | Click-to-fix lands you at…                      |
| ------------- | ---------------------------------------- | ----------------------------------------------- |
| `toggle-off`  | "Allow Qwen sessions" is OFF in Settings | Settings → Account → Allow Qwen sessions toggle |
| `key-missing` | No row of Qwen's supply list can serve (no Qwen key, and no other row ready) | Settings → Account → Qwen API key field, or Who pays & who serves |

**Test your key.** The Qwen API-key field has a **"Test key"** button that pings DashScope's models list (`dashscope-intl.aliyuncs.com/compatible-mode/v1/models`) with your key, returning one plain-language verdict (works / invalid key / out of balance / model not available) — so a misconfigured key surfaces _before_ you spawn a session rather than as a confusing mid-turn failure.

**Retired / unavailable model.** If a session's selected model is no longer accepted by DashScope — either Omniscio has removed it from the picker or the vendor killed a still-listed id server-side — Omniscio surfaces a clear _"this Qwen model is no longer available — open the model picker and choose another"_ and parks the session as `needs_you` / `recovery_failed`, instead of silently retrying the rejected request into the generic placeholder-stuck give-up loop. This shares the same anthropic-compat guards the DeepSeek/Kimi/GLM/MiniMax/Meta siblings use. See [provider-spawn-model-availability-contract.md](../../.claude/memory/contracts/provider-spawn-model-availability-contract.md).

**The real reason, not a blanket "model unavailable."** A Qwen rejection arrives the same way regardless of cause — a synthetic placeholder with zero output — so when the rejection is _not_ about the model (the account ran out of balance, the conversation outgrew the context window, the key became invalid, or you hit a rate limit), Omniscio reads DashScope's actual error off that placeholder and surfaces the _specific_ cause + fix: **out of balance** → top up the account, then resend; **conversation too long** → start a fresh session; **bad/expired key** → check the Qwen key in Settings; **rate-limited** → wait a moment, then resend. This shares the exact `classifyAnthropicCompatPlaceholderError` path the DeepSeek/Kimi/GLM/MiniMax/Meta siblings use.

### Cost tracking

Spend hits the standard `api_cost_log` table because the `claude` CLI emits per-turn cost events in its `stream-json` output and the spawn layer already plumbs those into the cost tracker. The `source` field on the cost row carries the provider ID (`qwen`), so the Stats → Spend dashboard breaks down Qwen spend separately from Claude/Codex/Gemini.

**Cost is re-priced, not taken verbatim.** The `claude` binary computes its `total_cost_usd` from its OWN (Claude) price table, which has no Qwen row — so it would bill Qwen at Claude rates. Qwen is therefore `costReporting: 'estimated'`, and Omniscio recomputes each turn's cost from the token counts × Qwen's real per-M rate via `repriceAnthropicCompatTurnCost` — the same token-pricing path all five sibling anthropic-compat vendors use. Rates ([model-pricing.ts](../../src/shared/model-pricing.ts) `MODEL_PRICING`, all per 1M tokens at Alibaba's Singapore/International list — the region `dashscope-intl` serves): **`qwen3.8-flash`** $0.16 in / $0.47 out; **`qwen3.8-max`** and its pinned checkpoint **`qwen3.8-max-0902`** $2.00 in / $6.00 out each, with a **$0.25 implicit-cache-read** rate (DashScope's published table, confirmed 2026-08-26; the 0902 checkpoint re-confirmed against Model Studio's price page 2026-09-02); **`qwen3.7-plus`** $0.40 in / $1.60 out; **`qwen3.8-27b`** $0.50 in / $3.00 out (both from the same Model Studio price page, confirmed 2026-09-19). See [central-ai-spend-contract.md](../../.claude/memory/contracts/central-ai-spend-contract.md).

Telemetry: every successful Qwen spawn fires the `spawn_non_claude_session` feature event, recording `{ provider: 'qwen' }` only — no session ID, project ID, or prompt content.

## For agents

### How it works under the hood

**Spawn-env redirect, no alternate manager.** DashScope publishes an Anthropic-compatible endpoint — same request/response shape as Anthropic's Messages API, just at a different base URL. So Omniscio reuses the existing `claude` CLI binary (the same one Claude sessions use) and redirects every HTTP call at spawn time by setting two environment variables on the child process:

- `ANTHROPIC_BASE_URL=https://dashscope-intl.aliyuncs.com/apps/anthropic` — sends every HTTP request to DashScope's compat endpoint instead of `api.anthropic.com`. Like DeepSeek/MiniMax (and unlike Meta's bare host), the base carries an `/apps/anthropic` **path**; the `claude` CLI appends `/v1/messages`. The base URL is env-overridable via `AMC_QWEN_BASE_URL` to point at a different DashScope region (US Virginia `dashscope-us.aliyuncs.com/apps/anthropic`; Beijing `dashscope.aliyuncs.com/apps/anthropic`).
- `ANTHROPIC_AUTH_TOKEN=<your Qwen API key>` — supersedes the Claude OAuth/API-key for this child only.

The child process never knows it isn't talking to Anthropic. Streaming, tool calls, `--resume` for multi-turn, `--output-format stream-json` parsing all "just work" because they're handled by the standard `claude` binary against an upstream that speaks the same protocol.

No alternate session manager exists for Qwen — readiness gates, the `spawn_non_claude_session` feature event fires, then it falls through to the same `createSessionWithPrompt()` path Claude sessions use. The `provider: 'qwen'` value is stored on the session row in the database; [spawn-cluster-manager.ts](../../src/main/process/spawn-cluster-manager.ts) reads that column and injects the right spawn-env on every CLI invocation (initial spawn, resume, aside-runner).

Because Qwen **runs the `claude` binary**, it is eligible for the same crash/restart/suspended/re-arm recovery as native Claude (`claude --resume` re-applies the Qwen env overlay from the session row) — distinct from Anthropic _account_ machinery (rate-limit recovery, load-balancing), which it stays out of since it authenticates with your Qwen key, not an Anthropic login.

> **Data locality (a China-vendor note).** The default `dashscope-intl` endpoint is **Singapore-hosted**, but Alibaba is a **China-based** vendor (the same jurisdiction as the OpenRouter → Alibaba helper leg). Prompt content sent from a Qwen session is processed by Alibaba under your own DashScope account. Qwen is listed as a cross-border subprocessor disclosure in [SUBPROCESSORS.md](../SUBPROCESSORS.md) (row #69).

### Files

- [src/shared/providers/registry.ts](../../src/shared/providers/registry.ts) — the `qwen` descriptor (`anthropic-compat` runtimeKind, capabilities, label, `pickerOrder` 22)
- [src/main/services/providers/main-registry.ts](../../src/main/services/providers/main-registry.ts) — the Qwen readiness wiring (toggle + API-key gates, no binary gate)
- [src/shared/providers/provider-setup-catalog.ts](../../src/shared/providers/provider-setup-catalog.ts) — the `dashscope-intl.aliyuncs.com/apps/anthropic` endpoint, models-list URL, and `AMC_QWEN_BASE_URL` region override
- [src/main/services/anthropic-compat-provider.ts](../../src/main/services/anthropic-compat-provider.ts) — the base URL + credential accessor (`ANTHROPIC_COMPAT_PROVIDERS` membership)
- [src/main/services/qwen-credential-store.ts](../../src/main/services/qwen-credential-store.ts) — the encrypted `qwenApiKey` store
- [src/main/db/migrations/20260826201344-allow-qwen-provider.ts](../../src/main/db/migrations/20260826201344-allow-qwen-provider.ts) — extends the `sessions.provider` allow-list to include `qwen`
- [src/main/process/spawn-cluster-manager.ts](../../src/main/process/spawn-cluster-manager.ts) — injects `ANTHROPIC_BASE_URL` + `ANTHROPIC_AUTH_TOKEN` per session row's `provider` column
- [src/shared/types/provider-readiness.ts](../../src/shared/types/provider-readiness.ts) — `ProviderId` union
- [src/shared/types/settings/accounts-providers-settings.ts](../../src/shared/types/settings/accounts-providers-settings.ts) — `allowQwenSessionSpawn` setting
- [src/shared/types/settings/ai-features-settings.ts](../../src/shared/types/settings/ai-features-settings.ts) — `qwenApiKey` setting
- [src/renderer/src/features/settings/sections/accounts/AnthropicCompatProvider.tsx](../../src/renderer/src/features/settings/sections/accounts/AnthropicCompatProvider.tsx) — the shared anthropic-compat settings card; Qwen's per-provider config was added here (shown under "Show alternative AI providers")
- [src/renderer/src/components/ui/QwenIcon.tsx](../../src/renderer/src/components/ui/QwenIcon.tsx) — the Qwen monogram icon
- [gateway/litellm/config.yaml](../../gateway/litellm/config.yaml) — the `qwen/<model>` lane rows a company-credit session routes through; a picker model with no row here stalls with no upstream
- [tests/unit/lint/company-credit-lane-routes.test.ts](../../tests/unit/lint/company-credit-lane-routes.test.ts) — locks the picker ↔ litellm-route invariant for this lane and every other credits-funded lane

## Related

Qwen shares its shape with a whole family of Anthropic-compatible providers, and the pages for its siblings — [meta-provider.md](meta-provider.md), [minimax-provider.md](minimax-provider.md), [glm-provider.md](glm-provider.md), [kimi-provider.md](kimi-provider.md) and [deepseek-provider.md](deepseek-provider.md) — describe the same arrangement with a different vendor and key; Meta is the fifth of them and the one that differs, carrying a bare-host base URL. [switching-providers.md](switching-providers.md) is the unified session-provider guide for how a session's provider is chosen and changed, [model-vendors.md](model-vendors.md) explains who pays for a Qwen session (its supply list), and the invariants all six of the siblings share are locked in [provider-registry-contract.md](../../.claude/memory/contracts/provider-registry-contract.md).
