Qwen Cloud Provider Setup for OpenClaw via Plugin
Covers the Qwen Cloud plugin for OpenClaw, including its provider ids, environment variables, and endpoint options. Useful for developers configuring Qwen or DashScope access in OpenClaw.
Read this when
- You want to use Qwen with OpenClaw
- You have an Alibaba Cloud Token Plan subscription
Qwen Cloud is an official external plugin for OpenClaw, and its primary id is qwen. It serves the Qwen Cloud / Alibaba DashScope Standard and Coding Plan endpoints, publishes Token Plan as qwen-token-plan, retains modelstudio as a compatibility alias, and separately claims Alibaba's documented custom-provider id bailian-token-plan.
| Property | Value |
|---|---|
| Provider | qwen |
| Token Plan provider | qwen-token-plan |
| Preferred env var | QWEN_API_KEY |
| Token Plan env var | QWEN_TOKEN_PLAN_API_KEY |
| Also accepted (compat) | MODELSTUDIO_API_KEY, DASHSCOPE_API_KEY |
| API style | OpenAI-compatible |
Tip
Coding Plan and Standard endpoints both accept
qwen3.7-plusandqwen3.6-plus. When you needqwen3.8-maxorqwen3.8-flash, pick Standard (pay-as-you-go) or Token Plan. Those models are absent from the older Coding Plan. Standard or Token Plan is likewise required forqwen3.7-maxandqwen3.6-flash.
Install plugin
qwen is distributed as an official external plugin and is not part of core. To add it:
openclaw plugins install @openclaw/qwen-provider
A running Gateway picks up the installation on its own; if none is running, the change applies at the next startup. Refer to Apply changes and inspect.
Getting started
Pick the plan type you use, then carry out the setup steps.
When all you provide is QWEN_API_KEY (or MODELSTUDIO_API_KEY / DASHSCOPE_API_KEY) and no models.providers.qwen.baseUrl, OpenClaw falls back to the Global Coding Plan endpoint: https://coding-intl.dashscope.aliyuncs.com/v1. Plan and region are not chosen by the environment variable's name. If your key is Standard pay-as-you-go, either run openclaw onboard --auth-choice qwen-standard-api-key or assign models.providers.qwen.baseUrl the value https://dashscope-intl.aliyuncs.com/compatible-mode/v1. An explicitly configured endpoint wins; pair it with the key for the matching plan and region.
Coding Plan (subscription)
Best for: access by subscription via the Qwen Coding Plan.
Get your API key
Obtain an API key from home.qwencloud.com/api-keys or copy an existing one.
Run onboarding
When using the Global endpoint:
openclaw onboard --auth-choice qwen-api-key
When using the China endpoint:
openclaw onboard --auth-choice qwen-api-key-cn
Set a default model
{
agents: {
defaults: {
model: { primary: "qwen/qwen3.5-plus" },
},
},
}
Verify the model is available
openclaw models list --provider qwen
Note
Older
modelstudio-*auth-choice ids andmodelstudio/...model refs continue to work as compatibility aliases, yet new setup flows ought to favor the currentqwen-*auth-choice ids andqwen/...model refs. Should you declare an exact custommodels.providers.modelstudioentry holding a differentapivalue,modelstudio/...refs belong to that custom provider rather than to the Qwen compatibility alias.
Standard (pay-as-you-go)
Best for: pay-as-you-go access via the Standard Model Studio endpoint, which covers qwen3.8-max and qwen3.8-flash, neither of which the older Coding Plan offers.
Get your API key
Obtain an API key from home.qwencloud.com/api-keys or copy an existing one.
Run onboarding
When using the Global endpoint:
openclaw onboard --auth-choice qwen-standard-api-key
When using the China endpoint:
openclaw onboard --auth-choice qwen-standard-api-key-cn
Set a default model
{
agents: {
defaults: {
model: { primary: "qwen/qwen3.5-plus" },
},
},
}
Verify the model is available
openclaw models list --provider qwen
Note
Older
modelstudio-*auth-choice ids andmodelstudio/...model refs remain functional as compatibility aliases, though fresh setup flows ought to favour the present-dayqwen-*auth-choice ids andqwen/...model refs. Should you declare an exact custommodels.providers.modelstudioentry carrying a differentapivalue, ownership ofmodelstudio/...refs passes to that custom provider rather than to the Qwen compatibility alias.
Token Plan (Team Edition)
Best for: team subscription access billed by credits to Qwen and supported third-party models, served through Alibaba Cloud Model Studio.
Get your dedicated key
Allocate a Token Plan seat, then generate the dedicated sk-sp-... key for it. Keys for Token Plan, Coding Plan, and pay-as-you-go cannot be swapped for one another. Consult the Global Token Plan overview or the China Token Plan overview.
Run onboarding
When targeting the Global / International endpoint hosted in Singapore:
openclaw onboard --auth-choice qwen-token-plan
When targeting the China endpoint hosted in Beijing:
openclaw onboard --auth-choice qwen-token-plan-cn
Verify the provider
openclaw models list --provider qwen-token-plan
openclaw agent --model qwen-token-plan/qwen3.7-plus --message "Reply with: token plan ready"
Note
Alibaba's OpenClaw guide relies on
bailian-token-planwhen defining a manual custom provider. That id is registered by the plugin as a compatibility owner, yet fresh configs ought to useqwen-token-plan. A custommodels.providers.bailian-token-planentry defined exactly retains ownership of the transport and catalog it was configured with; it never gets folded into the OpenAI catalog.
Warning
Restrict Token Plan to interactive OpenClaw sessions. It should not be chosen for cron jobs, unattended scripts, or application backends. According to Alibaba, non-interactive usage may lead to the subscription being suspended or its API key revoked.
Retired Qwen Portal authentication
The qwen-oauth Portal provider, together with its legacy OAuth flow, is gone. Portal tokens cannot be used in place of Qwen Cloud or DashScope API keys. Running the current Qwen plugin calls for fresh API-key authentication against the endpoint you pick, plus updated model configuration. Work through Install plugin and Getting started; credentials you already hold from Portal are not migrated for you.
Plan types and endpoints
| Plan | Region | Auth choice | Endpoint |
|---|---|---|---|
| Coding Plan (subscription) | China | qwen-api-key-cn | coding.dashscope.aliyuncs.com/v1 |
| Coding Plan (subscription) | Global | qwen-api-key | coding-intl.dashscope.aliyuncs.com/v1 |
| Standard (pay-as-you-go) | China | qwen-standard-api-key-cn | dashscope.aliyuncs.com/compatible-mode/v1 |
| Standard (pay-as-you-go) | Global | qwen-standard-api-key | dashscope-intl.aliyuncs.com/compatible-mode/v1 |
| Token Plan (Team Edition) | China | qwen-token-plan-cn | token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 |
| Token Plan (Team Edition) | Global | qwen-token-plan | token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 |
Which endpoint gets used is decided automatically by the provider from your auth choice. The qwen-* family covers current choices; modelstudio-* is kept for compatibility alone. You can override this by supplying a custom baseUrl in config.
Tip
Manage keys: home.qwencloud.com/api-keys | Docs: docs.qwencloud.com
Built-in catalog
Connection settings and model aliases, modelstudio aliases among them, survive setup, and generated catalog rows are not written into your config. Catalog seeding stays on when you set models.mode: "replace" explicitly; any custom model rows you have are preserved.
Models are discovered by OpenClaw through the authenticated /models API of whichever endpoint is configured. For offline discovery, and for endpoints that hand back model IDs only, the plugin retains the seed metadata listed below. Configs on Coding Plan leave out models that the plan does not cover; seeing a model in a Standard listing does not prove that Token Plan or Coding Plan grants access to it.
| Model ref | Input | Context | Notes |
|---|---|---|---|
qwen/qwen3.5-plus | text, image | 1,000,000 | Default model |
qwen/qwen3.6-flash | text, image | 1,000,000 | Standard endpoints only |
qwen/qwen3.6-plus | text, image | 1,000,000 | Coding Plan + Standard |
qwen/qwen3.7-max | text | 1,000,000 | Standard endpoints only |
qwen/qwen3.7-plus | text, image | 1,000,000 | Coding Plan + Standard |
qwen/qwen3.8-max | text, image | 1,000,000 | Standard endpoints only |
qwen/qwen3.8-flash | text, image | 1,000,000 | Standard endpoints only |
qwen/qwen3-max-2026-01-23 | text | 262,144 | Qwen Max line |
qwen/qwen3-coder-next | text | 262,144 | Coding |
qwen/qwen3-coder-plus | text | 1,000,000 | Coding |
qwen/MiniMax-M2.5 | text | 1,000,000 | Reasoning enabled |
qwen/glm-5 | text | 202,752 | GLM |
qwen/glm-4.7 | text | 202,752 | GLM |
qwen/kimi-k2.5 | text, image | 262,144 | Moonshot AI via Alibaba |
Note
A model can be listed in the seed catalog and still be unavailable, depending on the endpoint and billing plan. Newer chat models served by the endpoint may show up without any plugin update. To use models hosted on your own machine, follow the discovery flow for Ollama or LM Studio.
Token Plan catalog
Token Plan relies on its own allowlist, matched by exact string. The catalog shipped with the plugin lists the plan models Alibaba currently recommends. Any other allowlisted model ID can still be used, as a custom model ref. Plan models that only generate images are left out here, since they are served through different APIs.
| Model ref | Input | Context | Picker status |
|---|---|---|---|
qwen-token-plan/qwen3.7-plus | text, image | 1,000,000 | visible |
qwen-token-plan/qwen3.8-max | text, image | 1,000,000 | visible |
qwen-token-plan/qwen3.8-flash | text, image | 1,000,000 | visible |
qwen-token-plan/qwen3.6-plus | text, image | 1,000,000 | visible |
qwen-token-plan/kimi-k2.5 | text, image | 262,144 | visible |
qwen-token-plan/glm-5 | text | 202,752 | visible |
qwen-token-plan/MiniMax-M2.5 | text | 196,608 | visible |
Thinking controls
The thinking controls for a given model are shared by agent runs and standalone completions. That includes the Token Plan requirements for tool choice and reasoning replay.
Thinking levels off, low, medium, and xhigh are accepted by qwen3.8-max and qwen3.8-flash, and xhigh is the default. minimal is mapped to low, while high and max are mapped to xhigh. This holds for both Standard and Token Plan. Output is capped at 131,072 tokens on either model. When tools are in use, OpenClaw writes returned reasoning into its own reasoning_content replay field instead of putting it into the visible answer text.
If request parameters carry an explicit thinking_budget, it wins over the mapped reasoning_effort: a request that contains both is rejected by Qwen. Consult the Qwen thinking reference.
In the built-in catalog, qwen3.7-max, qwen3.7-plus, qwen3.6-flash, and qwen3.6-plus have reasoning enabled. On reasoning models in the qwen family, the provider translates OpenClaw thinking levels into DashScope's top-level enable_thinking request flag: enable_thinking: false is sent when thinking is disabled, and enable_thinking: true is sent for every other level. A custom model can opt into a different chat-template thinking payload by setting compat.thinkingFormat: "qwen-chat-template" on its model entry. If compat.supportedReasoningEfforts: ["low", "medium", "xhigh"] is declared together with compat.reasoningEffortMap: { "high": "xhigh" }, then chat_template_kwargs.reasoning_effort is also sent, using the Qwen 3.8 tier mapping described above, whenever a turn, session, or configuration picks a thinking level. When nothing is selected, OpenClaw leaves out the nested effort and the server template default stands.
Token Plan models also count as reasoning-capable. kimi-k2.7-code and MiniMax-M2.5 are thinking-only, so even if the session asks for /think off, OpenClaw leaves thinking on. DeepSeek V4 maps minimal through high onto the service's high effort, and xhigh or max onto max. The full minimal through max range is accepted by GLM 5.2; GLM 5.1 and GLM 5 accept up to xhigh, and high is the default for all three. Other hybrid models simply follow the on/off state that was requested.
Multimodal add-ons
Multimodal capabilities are exposed by the qwen plugin on Standard DashScope endpoints only, and not on the Coding Plan endpoints:
- Image and video understanding via
qwen3.6-plus - Wan video generation via
wan2.6-t2v(default),wan2.6-i2v,wan2.6-r2v,wan2.6-r2v-flash,wan2.7-r2v
Media understanding needs no additional configuration: it is resolved automatically from the Qwen auth you have set up. Just confirm that your endpoint is Standard (pay-as-you-go), since media understanding only works there.
Video generation
Call QWEN_API_KEY on a Standard endpoint. To set Qwen as the default video provider:
{
agents: {
defaults: {
mediaModels: { video: { primary: "qwen/wan2.6-t2v" } },
},
},
}
When a request carries exactly one reference image and no video, wan2.6-t2v switches to wan2.6-i2v on its own, and the response reports which model was resolved. Such routing happens only if the known model catalog contains an image-to-video sibling from the same generation. All other requests follow the mode of the model you selected:
| Mode | Models | Reference limits | Max duration | Supported controls |
|---|---|---|---|---|
| Text-to-video | wan2.6-t2v | n/a | 15 s | size, aspectRatio, resolution, audio, watermark |
| Image-to-video | wan2.6-i2v | 1 image | 15 s | resolution, audio, watermark |
| Reference-to-video (Wan 2.6) | wan2.6-r2v, wan2.6-r2v-flash | 5 total images/videos; up to 3 videos | 10 s | size, aspectRatio, resolution, audio, watermark |
| Reference-to-video (Wan 2.7) | wan2.7-r2v | 5 total images/videos; up to 3 videos | 10 s | size, aspectRatio, resolution, watermark; audio is always on |
Wan 2.6 text and reference models convert resolution together with aspectRatio into the exact documented size. For image-to-video, Wan 2.6 submits the resolution tier and takes the aspect ratio from the input image. Wan 2.7 reference-to-video submits media, resolution, and ratio, and audio is always generated.
For image-to-video, and for Wan 2.7 reference images, you may supply local files or remote http(s) URLs. Local images are transmitted as base64 data URIs, capped at 20 MB per image before encoding, which matches the Wan image input limit. Reference videos, along with Wan 2.6 reference-to-video images, must still be remote http(s) URLs.
Note
Shared tool parameters, provider selection, and failover behavior are covered in Video generation.
Advanced configuration
Qwen model availability
Coding Plan and Standard endpoints both serve qwen3.7-plus and qwen3.6-plus. To use qwen3.8-max, qwen3.8-flash, qwen3.7-max, or qwen3.6-flash, pick Standard or Token Plan instead. The Standard (pay-as-you-go) endpoints are:
- China:
dashscope.aliyuncs.com/compatible-mode/v1 - Global:
dashscope-intl.aliyuncs.com/compatible-mode/v1
OpenClaw leaves these models out of Coding Plan catalogs. Should a Coding Plan endpoint answer with an "unsupported model" error, move to the corresponding Standard or Token Plan endpoint and use its dedicated key.
Video generation region routing
Before it submits a video job, OpenClaw resolves the Qwen region you configured to the matching DashScope AIGC host:
- Global/Intl:
https://dashscope-intl.aliyuncs.com - China:
https://dashscope.aliyuncs.com
Even when a normal models.providers.qwen.baseUrl targets a Coding Plan or Standard Qwen host, video generation is still routed to the DashScope video endpoint for the matching region.
Streaming usage compatibility
On the shared openai-completions transport, native Qwen endpoints advertise streaming usage compatibility. As a result, DashScope-compatible custom provider ids that point at the same native hosts inherit that behavior, and the built-in qwen provider id is not specifically required. Coding Plan, Standard, and Token Plan endpoints all fall under this:
https://coding.dashscope.aliyuncs.com/v1https://coding-intl.dashscope.aliyuncs.com/v1https://dashscope.aliyuncs.com/compatible-mode/v1https://dashscope-intl.aliyuncs.com/compatible-mode/v1https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
Capability plan
The areas of Qwen Cloud that the qwen plugin currently handles:
- Text/chat models: provided by the plugin
- Tool calling, structured output, thinking: come from the OpenAI-compatible transport
- Image/video understanding: supported by the plugin on the Standard endpoint
- Video generation: supported by the plugin through the shared video-generation capability
- Image generation: the plugin does not expose this
- Speech/audio: the plugin does not expose this
- Memory embeddings/reranking: the plugin does not expose this
Environment and daemon setup
When the Gateway is run as a daemon (launchd/systemd), that process must be able to see QWEN_API_KEY
or QWEN_TOKEN_PLAN_API_KEY (set it in ~/.openclaw/.env, for instance, or through env.shellEnv).
Related
-
Model selection: how to pick providers, model refs, and failover behavior.
-
Video generation: the shared video tool's parameters and how a provider is chosen.
-
Alibaba Model Studio: the bundled Wan video generation provider, which runs on the same DashScope platform.
-
Troubleshooting: general troubleshooting and FAQ.