Skip to content

Get Qwen Coder and Vision Models Running for Free

I used to get hit with high API bills just for testing small scripts or debugging code. Then I realized Qwen offers a free tier for their Coder and Vision models through an OAuth flow. Getting 2,000 requests a day without paying a cent changed how I handle my daily dev tasks.

I found that the setup is fast, but you have to follow the steps in order to get the authentication right. Here is how I get it working in under five minutes.

  • OpenClaw installed on your machine.
  • An active Qwen account.
  • The OpenClaw CLI ready in your terminal.
  • A few minutes to click through the OAuth screens.

I recommend using the qwen-portal-auth plugin because it handles the token refresh for you. Follow these steps to get started.

1. Enable the plugin Run this command to tell OpenClaw to use the Qwen portal logic:

Terminal window
openclaw plugins enable qwen-portal-auth

2. Restart the Gateway You need to restart your OpenClaw Gateway process so it can load the plugin you just enabled.

3. Authenticate your account Run the login command. This starts a device-code flow. It will give you a link to open in your browser where you can sign in to Qwen.

Terminal window
openclaw models auth login --provider qwen-portal --set-default

This command also sets Qwen as your default provider and creates a qwen alias for you.

4. Select your model I usually stick with the coder model for my terminal work. You can switch to it instantly:

Terminal window
openclaw models set qwen-portal/coder-model

If you need to process images, use qwen-portal/vision-model instead.

Token Refresh Failures Sometimes the auto-refresh fails if your internet connection drops or if Qwen revokes the session. If you see auth errors, just run the login command again. It resets the tokens in your models.json and gets you back online.

Syncing from Qwen Code CLI If you used the Qwen Code CLI before, OpenClaw tries to grab your credentials from ~/.qwen/oauth_creds.json. However, you still need to run the openclaw models auth login command once. This ensures the models.providers.qwen-portal entry is correctly formatted in your OpenClaw config.

If you hit a wall or get an error I didn’t mention, talk to the AI Setup Assistant.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.