Model providers

Using Qwen with OpenClaw

4 min read

Browse more in Model providers.

All model providers guides →

This guide shows you how to configure Qwen as a model provider in OpenClaw using the new bundled `qwen` provider. 5-plus` as your agent default.

By the end, your OpenClaw setup will call Qwen for text, multimodal, and optional video generation where supported.

Setup flow

Prerequisites

  • An active Qwen Cloud account with access to either the Coding Plan (subscription) or Standard (pay-as-you-go) endpoints.
  • At least one Qwen API key created at https://home.qwencloud.com/api-keys.
  • OpenClaw installed with access to the `openclaw` CLI so you can run `openclaw onboard` and `openclaw models list`.
  • Network access from your OpenClaw environment to the DashScope or Coding endpoints such as `dashscope-intl.aliyuncs.com/compatible-mode/v1` or `coding-intl.dashscope.aliyuncs.com/v1`.

Steps

  1. 1

    Decide between Coding Plan and Standard endpoints

    Pick whether you want the Coding Plan (subscription) or Standard (pay-as-you-go) Qwen endpoints before you touch config. 6-plus` or multimodal/video features, while Coding Plan is focused on subscription-based coding and text access.

    text
    | Plan | Region | Auth choice | Endpoint |
    | --- | --- | --- | --- |
    | 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` |
    | 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` |
  2. 2

    Create or copy your Qwen API key

    You need a Qwen API key before running any OpenClaw onboarding flow. Generate or copy it from the Qwen Cloud console, and keep track of which plan and region it belongs to so you can match it with the right `auth-choice` later.

    text
    Create or copy an API key from https://home.qwencloud.com/api-keys.
  3. 3

    Run onboarding for the Coding Plan endpoint

    If you use the Coding Plan subscription, run the Qwen onboarding flow with the Coding Plan auth choices. Pick the Global or China variant to match where your key was issued so OpenClaw targets the correct Coding endpoint.

    bash
    openclaw onboard --auth-choice qwen-api-key
    
    openclaw onboard --auth-choice qwen-api-key-cn
  4. 4

    Run onboarding for the Standard (pay-as-you-go) endpoint

    If you use the Standard Model Studio endpoint, run onboarding with the Standard auth choices instead. 6-plus` or multimodal/video features that are only available on the Standard DashScope-compatible hosts.

    bash
    openclaw onboard --auth-choice qwen-standard-api-key
    
    openclaw onboard --auth-choice qwen-standard-api-key-cn
  5. 5

    Set Qwen as the default text model for your agents

    After onboarding, configure your agent defaults so OpenClaw routes text and chat calls to Qwen. ` model ref.

    json
    {
      agents: {
        defaults: {
          model: { primary: "qwen/qwen3.5-plus" },
        },
      },
    }
  6. 6

    Verify Qwen models are available in OpenClaw

    Before wiring Qwen into production agents, list the models OpenClaw sees for the `qwen` provider. This confirms your auth choice, endpoint, and API key are all wired correctly and that the bundled catalog is visible.

    bash
    openclaw models list --provider qwen
  7. 7

    Configure Qwen as the default video generation provider (optional)

    If you use Qwen’s Wan video generation on the Standard endpoints, set it as the default video provider in your agent defaults. 6-t2v` while keeping region mapping aligned with your Qwen auth.

    json
    {
      agents: {
        defaults: {
          videoGenerationModel: { primary: "qwen/wan2.6-t2v" },
        },
      },
    }

Configuration

OptionDescriptionExample
QWEN_API_KEYPreferred environment variable for the bundled `qwen` provider; OpenClaw uses it to authenticate requests to Qwen Cloud.sk-qwen-abc1234567890
MODELSTUDIO_API_KEYCompatibility environment variable that OpenClaw still accepts for Qwen, kept for legacy ModelStudio-based setups.sk-modelstudio-xyz0987654321
DASHSCOPE_API_KEYCompatibility environment variable for DashScope-based Qwen access; OpenClaw accepts it alongside `QWEN_API_KEY`.sk-dashscope-1122334455
agents.defaults.model.primarySets the default primary text/chat model for your agents, such as the bundled Qwen model ref.qwen/qwen3.5-plus
agents.defaults.videoGenerationModel.primarySets the default video generation model for your agents when using Qwen’s Wan video generation.qwen/wan2.6-t2v
models.providers.qwen.baseUrlOptional override for the Qwen provider base URL if you need a custom endpoint instead of the auto-selected one.https://dashscope-intl.aliyuncs.com/compatible-mode/v1

Troubleshooting

Coding Plan endpoints return an “unsupported model” error when you call `qwen3.6-plus`.

6-plus` is only available on the Standard (pay-as-you-go) Model Studio endpoints. com/compatible-mode/v1` instead.

bash
openclaw onboard --auth-choice qwen-standard-api-key
# or
openclaw onboard --auth-choice qwen-standard-api-key-cn

Video understanding or Wan video generation calls fail when using a Coding Plan key.

Multimodal surfaces (video understanding and Wan video generation) only work on the Standard DashScope endpoints, not the Coding Plan endpoints. Re-onboard with a Standard auth choice so the `qwen` extension can register media understanding and video generation correctly.

bash
openclaw onboard --auth-choice qwen-standard-api-key
# or
openclaw onboard --auth-choice qwen-standard-api-key-cn

The OpenClaw Gateway daemon cannot access Qwen even though `QWEN_API_KEY` works in your shell.

When the Gateway runs under launchd or systemd, it does not inherit your interactive shell environment. shellEnv`.

bash
Environment and daemon setup

If the Gateway runs as a daemon (launchd/systemd), make sure `QWEN_API_KEY` is available to that process (for example, in `~/.openclaw/.env` or via `env.shellEnv`).

Frequently asked questions

Powered by Mem0

Add persistent memory to OpenClaw

Official Mem0 plugin for OpenClaw keeps context across chats and tools. Smaller prompts, lower cost, better continuity for your agents.

More in Model providers