Use Alibaba Cloud Model Studio models in OpenClaw.
Quick Start
- 1
- 2
Get an API key
- Token Plan
- Pay-as-you-go
- Coding Plan
Get a Token Plan API key for your edition:- Token Plan Personal Edition: Create or view API Key
- Token Plan Team Edition: Assign a seat and get the API Key
- 3
Configure the model
Run the command for your billing plan and enter the API key when prompted.- Token Plan
- Pay-as-you-go
- Coding Plan
- 4
Verify
Run the following commands to check the model list and a test call:
Configure with a configuration file
Use this method if the Qwen plugin cannot be installed or you prefer to manage the configuration manually.
- 1
Open or create the configuration file
~/.openclaw/openclaw.jsonUpdate only the relevant fields inmodels,agents, andgateway. Do not replace the entire file. - 2
Write the configuration
- Token Plan Personal Edition
- Token Plan Team Edition
- Pay-as-you-go
- Coding Plan
ReplaceYOUR_API_KEYwith your Token Plan Personal Edition API key.
gateway.auth.mode: none is suitable only for local single-machine use. To share or access remotely, run openclaw doctor --generate-gateway-token to generate a token, then restart the Gateway.Connect messaging channels
- DingTalk
- WeChat
- QQ
- 1
Create a DingTalk application and get credentials
- Log in to the DingTalk Open Platform, select an organization for which you have developer permissions, or create an organization and then obtain developer permissions.
- In the top menu bar, select Application Development, click Create Application, enter an application name and description, and then click Save.
- On the Add Application Capabilities page, add a Bot. Enable Bot Configuration, fill in the required fields, keep the default Stream mode for message receiving mode, and click Publish.
- On the Credentials and Basic Information page, get the Client ID and Client Secret.
- On the Version Management and Release page, create a version, set the visibility range, save, and publish.
- 2
Install the DingTalk channel plugin
The output should include thedingtalkplugin with a status ofloaded. - 3
Configure the DingTalk channel
Add the following configurations to~/.openclaw/openclaw.json. ReplaceYOUR_DINGTALK_APPKEYandYOUR_DINGTALK_APPSECRETwith the credentials from Step 1. Do not overwrite existing configurations such asmodelsandagents.Setting bothdmPolicyandgroupPolicytoopenis suitable for testing or personal use. In a production environment, set them toallowlistand add theallowFromfield: - 4
Verify
In the Channels section, DingTalk should beONwith a status ofOK - configured. Send a message to the bot in a DingTalk group chat to test the connection.
Lark
- 1
Create a Lark application
- Go to the Lark Open Platform, click Create Custom Enterprise App, enter an application name and description, select an icon, and then click Create.
- On the Credentials and Basic Information page, copy the App ID (in the format
cli_xxx) and App Secret. - On the Permission Management page, click Batch Import/Export Permissions, paste the following JSON, click Next, Confirm New Permissions, and then click Apply for Activation.
- On the Add Application Capabilities page, select the Add by Capability tab, find the Robot card, and click Configure.
- Under Events & Callbacks, on the Event Configuration tab, set Subscription Method to Use long-lived connection to receive events and save. Then add the event
im.message.receive_v1. - On the Version Management and Release page, create a version, enter the version number and update description, save, and submit for review and publication.
- 2
Configure the Lark bot
Runopenclaw channels add, select Feishu, and enter the App ID and App Secret. Then restart the gateway:Add the bot to a Lark group chat, or send a message to the bot. The bot replies with a message containing a pairing code. Copy the last line and send it in the OpenClaw chat to complete pairing. - 3
Verify
In the Channels section, Lark should beONwith a status ofOK. Send a message in Lark to test the connection.
Error codes
If you encounter errors during configuration, refer to the FAQ documentation for your billing plan:
- Token Plan: Personal Edition FAQ · Team Edition FAQ
- Pay-as-you-go: Error codes
- Coding Plan: Coding Plan FAQ
FAQ
How do I use a savings plan with pay-as-you-go?
How do I use a savings plan with pay-as-you-go?
How can I view my configured models?
How can I view my configured models?
openclaw tui in the terminal to start the OpenClaw terminal command line, and then enter /model to view the model list. Press Enter to select a model and Esc to exit the list.Why do I get the errors HTTP 401: Incorrect API key provided., No API key found for provider xxx, or HTTP 401: invalid_iam_token?
Why do I get the errors HTTP 401: Incorrect API key provided., No API key found for provider xxx, or HTTP 401: invalid_iam_token?
- The API key is invalid, expired, empty, incorrectly formatted, or for the wrong endpoint. Ensure the API key matches your payment method, is copied completely without extra spaces, and that your subscription is active.
- OpenClaw is using an incorrect, stale configuration from its configuration cache. Delete the
providersconfiguration item from~/.openclaw/agents/main/agent/models.jsonand restart OpenClaw. invalid_iam_tokenindicates that the API key failed IAM authentication. Common scenarios include: the API key has been revoked or disabled; the API key's region does not match the Base URL region (for example, the API key was created in Singapore, but the Base URL points to another region); or an STS temporary credential has expired. Verify that the API key and Base URL belong to the same region and that the API key status is active.
I have already configured other channels such as DingTalk. How can I safely add models for a new plan?
I have already configured other channels such as DingTalk. How can I safely add models for a new plan?
- Do not use a replace-all function. It overwrites custom configurations. Modify only the relevant sections.
- If OpenClaw is responding normally, enter the commands directly in an OpenClaw chat to merge the configuration.
- If OpenClaw has no models configured or is not responding, manually edit
~/.openclaw/openclaw.json. Modify only the relevant fields and leave the existing configuration unchanged.
What should I do if I get a device identity required error?
What should I do if I get a device identity required error?
- You are accessing the URL in a browser for the first time, and device pairing is not complete.
- The browser cache was cleared, causing the device key to be lost.
- After reinstalling or upgrading OpenClaw, the key file in the
~/.openclaw/identity/directory is missing.
openclaw devices list to confirm the device appears in the Paired list.Token consumption occurs even when OpenClaw is not actively in use
Token consumption occurs even when OpenClaw is not actively in use
~/.openclaw/agents/main/sessions/. Heartbeat calls are marked with [OpenClaw heartbeat poll].Solutions:- Stop the gateway: run
openclaw gateway stopwhen not in use. This stops the heartbeat immediately. - Increase the heartbeat interval: set
agents.defaults.heartbeat.everyin~/.openclaw/openclaw.json. For example,"2h"sets the interval to every 2 hours.