OpenClaw is an open source personal AI assistant platform that lets you interact with AI through various messaging channels. You can configure it to access AI models from Alibaba Cloud Model Studio. It supports four access methods: pay-as-you-go, Coding Plan, Token Plan Personal Edition, and Token Plan Team Edition.
Install OpenClaw
OpenClaw requires Node.js 22.19.0 or later. To check your version:
- macOS / Linux
- Windows
openclaw onboard to configure it manually.
Parameter | Recommendation |
I understand this is powerful and inherently risky. Continue? | Select Yes |
Onboarding mode | Select QuickStart |
Model/auth provider | Select Skip for now (you can configure a Model Studio model later) |
Filter models by provider | Select All providers |
Default model | Select Keep current |
Select channel (QuickStart) | Select Skip for now (you can configure a channel later) |
Configure skills now? (recommended) | Select No |
Enable hooks? | Press the Spacebar to select an option, then press Enter. |
How do you want to hatch your bot? | Select Do this later |
Configure access credentials
Token Plan Personal Edition
Item | Description |
|---|---|
API Key | Dedicated API Key for the Token Plan Personal Edition |
Base URL |
|
Available models | All models included in the Token Plan Personal Edition |
~/.openclaw/openclaw.json. OpenClaw automatically reads this file on startup.
auth.mode: none), suitable only for single-machine local use. For shared or remote access, run openclaw doctor --fix to enable token authentication.YOUR_API_KEY with your API Key for the Token Plan Personal Edition.
For an existing configuration: To preserve your current settings, do not replace the entire file content. See How to safely modify an existing configuration.
Token Plan Team Edition
Item | Description |
|---|---|
API Key | Dedicated API Key for the Token Plan Team Edition |
Base URL |
|
Available models | All models included in the Token Plan Team Edition |
~/.openclaw/openclaw.json. OpenClaw automatically reads this file on startup.
auth.mode: none), suitable only for single-machine local use. For shared or remote access, run openclaw doctor --fix to enable token authentication.- Method 1: Terminal
- Method 2: Web UI
- Open the configuration file
-
Add the configuration
For a new configuration: Copy the following content into the configuration file. Replace
YOUR_API_KEYwith your API Key for the Token Plan Team Edition. For an existing configuration: To preserve your current settings, do not replace the entire file content. See How to safely modify an existing configuration.
-
Save and exit
Press
Ctrl+X, pressYto confirm saving, and then pressEnterto confirm the file name. - Apply the configuration To apply the changes, restart the gateway with the following command:
Coding Plan
Item | Description |
|---|---|
API Key | Dedicated API Key for the Coding Plan, in the format |
Base URL | |
Available models | All models included in the Coding Plan |
~/.openclaw/openclaw.json. OpenClaw automatically reads this file on startup.
auth.mode: none), suitable only for single-machine local use. For shared or remote access, run openclaw doctor --fix to enable token authentication.- Method 1: Terminal
- Method 2: Web UI
- Open the configuration file
-
Add the configuration
For a new configuration: Copy the following content into the configuration file. Replace
YOUR_API_KEYwith your Coding Plan API Key. For an existing configuration: To preserve your current settings, do not replace the entire file content. See How to safely modify an existing configuration.
-
Save and exit
Press
Ctrl+X, pressYto confirm saving, and then pressEnterto confirm the file name. - Apply the configuration To apply the changes, restart the gateway with the following command:
Pay-as-you-go
Item | Description |
|---|---|
API Key | Model Studio API Key, in the format |
Base URL | Ensure your Base URL, API Key, and model all correspond to the same region:
|
Available models | All models available in the Model Market |
~/.openclaw/openclaw.json. OpenClaw automatically reads this file on startup. The following examples use the China (Beijing) region. If you use a different region, replace the baseUrl with the corresponding URL from the table above.
auth.mode: none), suitable only for single-machine local use. For shared or remote access, run openclaw doctor --fix to enable token authentication.- Method 1: Terminal
- Method 2: Web UI
- Open the configuration file
-
Add the configuration
For a new configuration: Copy the following content into the configuration file. Replace
YOUR_API_KEYwith your Model Studio API Key. For an existing configuration: To preserve your current settings, do not replace the entire file content. See How to safely modify an existing configuration.
-
Save and exit
Press
Ctrl+X, pressYto confirm saving, and then pressEnterto confirm the file name. - Apply the configuration To apply the changes, restart the gateway with the following command:
Connect to message channels
WhatsApp
Step 1: Install the WhatsApp plugin
The WhatsApp channel is connected via a plugin. Run the following command to install it:
Step 2: Configure the WhatsApp channel
Enter the following prompt in your OpenClaw chat. OpenClaw will ask for your phone number in E.164 format (a + sign followed by the country code and number), then automatically add the number to the configuration and complete the setup.
selfChatMode. The bot will then respond only in your "Message yourself" chat, leaving other conversations unaffected.Step 3: Link with WhatsApp
- Start the WhatsApp linking process. The terminal displays a QR code.
- Open WhatsApp on your phone and scan the QR code in the terminal to link your account.
- Restart the gateway.
Step 4: Test
- Check the WhatsApp channel status:
ON with a status of OK.
2. In WhatsApp, send a message to yourself to verify that the bot responds correctly.
Telegram
-
Create a bot usingBotFather
Send the
/newbotcommand, follow the prompts to enter a bot name and username (the username must end withbot), and copy and save the returned bot token (format:123456789:ABCdefGHIjklMNOpqrsTUVwxyz). -
In your OpenClaw chat, enter the following prompt and replace
xxxxwith your actual bot token. OpenClaw will automatically apply the configuration.
- After the configuration is complete, restart the gateway.
- In Telegram, send a message to your bot. When you send your first message, you will receive a pairing code.
- In your terminal, run the following command, replacing
xxxwith the actual pairing code:
Discord
Step 1: Create a Discord application and bot
- Create a Discord application Go to the Discord Developer Portal, click New Application, enter an application name, and then click Create.
-
Create a bot and enable permissions
- In the left navigation pane, click Bot and set a username for the bot.
-
On the Bot page, scroll down to Privileged Gateway Intents and enable the following intents:
- Message Content Intent
- Server Members Intent
- Presence Intent
- Get the bot token At the top of the Bot page, click Reset Token to generate a token. This token is displayed only once, so copy it and store it in a secure location immediately.
-
Add the bot to a server
- In the left navigation pane, click OAuth2 and scroll down to OAuth2 URL Generator.
-
Under Scopes, select the
botandapplications.commandscheckboxes. -
In the Bot Permissions section that appears, select the following permissions:
- View Channels
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Copy the URL generated at the bottom of the page, open it in your browser, select the target server, and click Continue to add the bot.
Step 2: Configure Discord in OpenClaw
- On the machine where OpenClaw is running, set the bot token as an environment variable.
- Complete the Discord configuration:
- Restart the gateway to apply the configuration.
Step 3: Pair and test
- In Discord, send a direct message to the bot. When you send your first message, you will receive a pairing code.
- In your terminal, run the following command to complete the pairing, replacing
xxxwith the actual pairing code:
- Check the Discord channel status:
ON with a status of OK.
4. Send a message in Discord to test the connection.
Common commands
Command | Description | Example |
|---|---|---|
/help | Lists available commands. | /help |
/status | Shows the current model, session, and gateway status. | /status |
/model <model_name> | Switches the model for the current session. | /model qwen3.7-max |
/new | Starts a new session. | /new |
/compact | Compresses conversation history to free up context window space. | /compact |
/think <level> | Sets the inference depth. Available levels are off, low, medium, and high. | /think high |
/skills | Lists available skills. | /skills |
Use cases
Use case 1: Automate X (Twitter)
You can use OpenClaw to automate your X (Twitter) account, including posting, replying, searching, and browsing your timeline.
Configuration steps
Configuration steps
- Install twitter-cli:
- Enter the following command in an OpenClaw dialog to automatically install the Skill.
- Restart the gateway to activate the Skill.
- Verify the installation:
- twitter-cli uses browser cookies for authentication. Ensure that you are logged in to x.com in a supported browser, such as Chrome, Edge, Firefox, Arc, or Brave. twitter-cli automatically retrieves the cookies. Alternatively, you can manually set the authentication information using environment variables:
auth_token and ct0.Example 1: Automatically publish a post
Example 1: Automatically publish a post
Check Sam Altman's recent tweets, summarize the key points, and then help me post a tweet with my thoughts in an OpenClaw dialog. OpenClaw automatically fetches the feed, analyzes the content, and publishes the post.Example 2: Search for trending topics
Example 2: Search for trending topics
Search for tweets about harness engineering from yesterday. OpenClaw searches for relevant tweets and summarizes their key points.Use case 2: Analyze and download YouTube videos
You can use OpenClaw to search for YouTube videos, extract video information, and download videos. It supports searching by keyword, sorting by date, and bulk-fetching video metadata.
Configuration steps
Configuration steps
- Install yt-dlp:
- Verify the installation:
- (Optional) Configure cookie authentication. This is required to access age-restricted, members-only, or private videos. Ensure that you are logged in to youtube.com in your browser, and then enter the following in an OpenClaw dialog:
yt-dlp command to perform video-related operations.Example 1: Summarize video content
Example 1: Summarize video content
Summarize the main points of this video: https://www.youtube.com/watch?v=XRgGFQ0EgM0 in an OpenClaw dialog. OpenClaw retrieves the video information and generates a summary.Example 2: Download a video
Example 2: Download a video
Download this video: https://www.youtube.com/watch?v=XRgGFQ0EgM0 in an OpenClaw dialog. OpenClaw runs yt-dlp to download the video to your local machine.Use case 3: Schedule daily AI news delivery
You can use OpenClaw's cron feature to automatically fetch the latest AI news and push it to WhatsApp daily.
Configuration steps
Configuration steps
- In your terminal:
Parameter | Description |
|---|---|
| The task name. |
| The cron expression. |
| The time zone. Set to |
| The prompt sent to the agent, which specifies what content to fetch and how to summarize it. |
| The push channel. Set to |
| Pushes the task's output to the specified recipient. |
| The recipient's WhatsApp phone number in E.164 format, which includes a plus sign, country code, and phone number. |
- List all tasks to get the task ID:
- Manually trigger the task:
- Check the execution result:
"status": "ok" and "delivered": true, the news has been successfully delivered to WhatsApp.Use case 4: Stock market analysis
You can use OpenClaw to analyze stock trends and receive technical analysis and investment suggestions.
Configuration steps
Configuration steps
- Install the Skill. Enter the following instruction in an OpenClaw dialog. OpenClaw will automatically complete the installation.
- Restart the gateway to activate the Skill.
- In an OpenClaw dialog, ask stock-related questions, such as
Analyze NVDA stock.
Learn more
Skill
Skills are extensible modules that provide new capabilities. The agent automatically matches and loads the appropriate Skill based on the user's request. OpenClaw allows you to view and enable built-in Skills, install community Skills from ClawHub, or create custom Skills.
Viewing existing skills
- View your installed Skills and their status:
- Built-in Skills are disabled by default. To enable them, you must add them to the
skills.allowBundledallowlist in~/.openclaw/openclaw.json. OpenClaw loads only the built-in Skills listed in this array.
skills.entries field of ~/.openclaw/openclaw.json. For details, refer to the Skills Configuration documentation.
Finding more skills
You can find and install more Skills using one of the following methods.
- Search and install from ClawHub ClawHub offers over 3,000 community Skills. You can browse them on the website or search for them from the command line.
-
Ask OpenClaw directly
Describe your needs directly in the chat, for example,
Help me find a Skill that can check the weather. OpenClaw will automatically search for and install a matching Skill.
Creating a custom skill
- Create a directory for your Skill.
- In this directory, create the
SKILL.mdfile. The file consists of two parts: YAML front matter and Markdown instructions. Thenameanddescriptionfields are required. The Agent uses thedescriptionto determine whether to load the Skill. Ensure that the description is accurate.
- Restart the gateway to apply the Skill.
FAQ
How can I view my configured models?
How can I view my configured models?
openclaw tui in your terminal. 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 error HTTP 401: Incorrect API key provided. , No API key found for provider xxx , or HTTP 401: invalid_iam_token ?
Why do I get the error HTTP 401: Incorrect API key provided. , No API key found for provider xxx , or HTTP 401: invalid_iam_token ?
- The API key might be invalid, expired, empty, incorrectly formatted, or for the wrong endpoint. Ensure the API key corresponds to your payment method, is copied completely without extra spaces, and that your account subscription is active.
- OpenClaw may be using an incorrect, stale configuration from its configuration cache. To resolve this, delete the
providersconfiguration item from the~/.openclaw/agents/main/agent/models.jsonfile and 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 China (Beijing), but the Base URL points to Singapore); 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 like DingTalk. How can I safely add models for a new plan without losing my existing configuration?
I have already configured other channels like DingTalk. How can I safely add models for a new plan without losing my existing configuration?
- Do not use a "Replace All" function, as this will overwrite your custom configuration. Instead, modify only the relevant sections.
-
Use one of the following methods to complete the configuration:
- 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 the
~/.openclaw/openclaw.jsonfile. Modify only the relevant fields and leave your 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 yet 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/ directory. 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.