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.

PropertyValue
Providerqwen
Token Plan providerqwen-token-plan
Preferred env varQWEN_API_KEY
Token Plan env varQWEN_TOKEN_PLAN_API_KEY
Also accepted (compat)MODELSTUDIO_API_KEY, DASHSCOPE_API_KEY
API styleOpenAI-compatible

Tip

Coding Plan and Standard endpoints both accept qwen3.7-plus and qwen3.6-plus. When you need qwen3.8-max or qwen3.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 for qwen3.7-max and qwen3.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 and modelstudio/... model refs continue to work as compatibility aliases, yet new setup flows ought to favor the current qwen-* auth-choice ids and qwen/... model refs. Should you declare an exact custom models.providers.modelstudio entry holding a different api value, 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 and modelstudio/... model refs remain functional as compatibility aliases, though fresh setup flows ought to favour the present-day qwen-* auth-choice ids and qwen/... model refs. Should you declare an exact custom models.providers.modelstudio entry carrying a different api value, ownership of modelstudio/... 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-plan when defining a manual custom provider. That id is registered by the plugin as a compatibility owner, yet fresh configs ought to use qwen-token-plan. A custom models.providers.bailian-token-plan entry 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

PlanRegionAuth choiceEndpoint
Coding Plan (subscription)Chinaqwen-api-key-cncoding.dashscope.aliyuncs.com/v1
Coding Plan (subscription)Globalqwen-api-keycoding-intl.dashscope.aliyuncs.com/v1
Standard (pay-as-you-go)Chinaqwen-standard-api-key-cndashscope.aliyuncs.com/compatible-mode/v1
Standard (pay-as-you-go)Globalqwen-standard-api-keydashscope-intl.aliyuncs.com/compatible-mode/v1
Token Plan (Team Edition)Chinaqwen-token-plan-cntoken-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
Token Plan (Team Edition)Globalqwen-token-plantoken-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 refInputContextNotes
qwen/qwen3.5-plustext, image1,000,000Default model
qwen/qwen3.6-flashtext, image1,000,000Standard endpoints only
qwen/qwen3.6-plustext, image1,000,000Coding Plan + Standard
qwen/qwen3.7-maxtext1,000,000Standard endpoints only
qwen/qwen3.7-plustext, image1,000,000Coding Plan + Standard
qwen/qwen3.8-maxtext, image1,000,000Standard endpoints only
qwen/qwen3.8-flashtext, image1,000,000Standard endpoints only
qwen/qwen3-max-2026-01-23text262,144Qwen Max line
qwen/qwen3-coder-nexttext262,144Coding
qwen/qwen3-coder-plustext1,000,000Coding
qwen/MiniMax-M2.5text1,000,000Reasoning enabled
qwen/glm-5text202,752GLM
qwen/glm-4.7text202,752GLM
qwen/kimi-k2.5text, image262,144Moonshot 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 refInputContextPicker status
qwen-token-plan/qwen3.7-plustext, image1,000,000visible
qwen-token-plan/qwen3.8-maxtext, image1,000,000visible
qwen-token-plan/qwen3.8-flashtext, image1,000,000visible
qwen-token-plan/qwen3.6-plustext, image1,000,000visible
qwen-token-plan/kimi-k2.5text, image262,144visible
qwen-token-plan/glm-5text202,752visible
qwen-token-plan/MiniMax-M2.5text196,608visible

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:

ModeModelsReference limitsMax durationSupported controls
Text-to-videowan2.6-t2vn/a15 ssize, aspectRatio, resolution, audio, watermark
Image-to-videowan2.6-i2v1 image15 sresolution, audio, watermark
Reference-to-video (Wan 2.6)wan2.6-r2v, wan2.6-r2v-flash5 total images/videos; up to 3 videos10 ssize, aspectRatio, resolution, audio, watermark
Reference-to-video (Wan 2.7)wan2.7-r2v5 total images/videos; up to 3 videos10 ssize, 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/v1
  • https://coding-intl.dashscope.aliyuncs.com/v1
  • https://dashscope.aliyuncs.com/compatible-mode/v1
  • https://dashscope-intl.aliyuncs.com/compatible-mode/v1
  • https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
  • https://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).

2,585 words · updated Oct 25, 2026