Skip to main content
Use in AI Tools

OpenClaw

Use Token Plan with OpenClaw

OpenClaw is an open-source AI assistant platform that connects AI models through Web UI and TUI.

Install OpenClaw

1

Install Node.js

OpenClaw requires Node.js v22.0+. Check your version:
node -v
If not installed or below v22.0, download from Node.js (LTS, v22.x or later).
2

Install OpenClaw

macOS/Linux:
curl -fsSL https://openclaw.ai/install.sh | bash
Windows (PowerShell, run as administrator):
iwr -useb https://openclaw.ai/install.ps1 | iex
3

Configure

Follow the on-screen prompts. Use these recommended settings:
ParameterValue
I understand this is powerful and inherently risky. Continue?Select "Yes"
Onboarding modeSelect "QuickStart"
Model/auth providerSelect "Skip for now". You can configure this later.
Filter models by providerSelect "All providers"
Default modelKeep the default setting.
Select channel (QuickStart)Select "Skip for now". You can configure this later.
Configure skills now? (recommended)Select "No". You can configure this later.
Enable hooks?Press the Spacebar to select "Skip for now", then press the Enter key.
How do you want to hatch your bot?Select "Hatch in TUI".

Configure Token Plan in OpenClaw

  • Use terminal
  • Use web browser
1

Open the configuration file

nano ~/.openclaw/openclaw.json
2

Paste the configuration

First-time configuration: Copy the following content to the configuration file. Replace YOUR_API_KEY with your Token Plan API key.Existing configuration: If you have an existing configuration, do not replace the entire content. For more information, see How to safely modify an existing configuration.
{
  "models": {
    "mode": "merge",
    "providers": {
      "bailian": {
        "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
        "apiKey": "YOUR_API_KEY",
        "api": "openai-completions",
        "models": [
          {
            "id": "qwen3.6-plus",
            "name": "qwen3.6-plus",
            "reasoning": false,
            "input": ["text", "image"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 1000000,
            "maxTokens": 65536,
            "compat": {
              "thinkingFormat": "qwen"
            }
          },
          {
            "id": "MiniMax-M2.5",
            "name": "MiniMax-M2.5",
            "reasoning": false,
            "input": ["text"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 196608,
            "maxTokens": 32768
          },
          {
            "id": "glm-5",
            "name": "glm-5",
            "reasoning": false,
            "input": ["text"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 202752,
            "maxTokens": 16384,
            "compat": {
              "thinkingFormat": "qwen"
            }
          },
          {
            "id": "deepseek-v3.2",
            "name": "deepseek-v3.2",
            "reasoning": false,
            "input": ["text"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 163840,
            "maxTokens": 16384,
            "compat": {
              "thinkingFormat": "qwen"
            }
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "bailian/qwen3.6-plus"
      },
      "models": {
        "bailian/qwen3.6-plus": {},
        "bailian/MiniMax-M2.5": {},
        "bailian/glm-5": {},
        "bailian/deepseek-v3.2": {}
      }
    }
  },
  "gateway": {
    "mode": "local"
  }
}
3

Apply the configuration

Save and exit, then restart the gateway:
openclaw gateway restart

Use OpenClaw

  • Web browser
  • CLI
openclaw dashboard

Common commands

CommandDescriptionExample
/helpLists available commands./help
/statusShows the current model, session, and gateway./status
/model <model_name>Switches the model for the current session./model qwen3.6-plus
/newStarts a new session./new
/compactCompacts the conversation history, freeing space in the context window./compact
/think <level>Sets the inference depth level. Options include off, low, medium, and high./think high
/skillsLists all available skills./skills

Switch models

  • Switch model in current session (temporary)
/model qwen3.6-plus
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "bailian/qwen3.6-plus"
      }
    }
  }
}
Text models (such as qwen3.6-plus and glm-5) work out of the box. Image generation models use a separate API and must be integrated through extension mechanisms. See Integrate multimodal generation models.

Integrate message channels

  • WhatsApp
  • Telegram
  • Discord

Step 1: Install the WhatsApp plugin

The WhatsApp channel is integrated as a plugin. Run the following command to install the plugin:
openclaw plugins install @openclaw/whatsapp

Step 2: Configure the WhatsApp channel

Enter the following prompt in an OpenClaw conversation. OpenClaw will ask for your phone number, which must be in E.164 format (a plus sign, followed by the country code and phone number). It then automatically adds the number to the configuration and completes the setup.
Please help me configure the WhatsApp channel. First, ask for my phone number, then automatically fill the number into the allowFrom and groupAllowFrom fields in the following configuration and complete the setup.
{
  "channels": {
    "whatsapp": {
      "dmPolicy": "pairing",
      "allowFrom": ["<phone_number>"],
      "groupPolicy": "allowlist",
      "groupAllowFrom": ["<phone_number>"]
    }
  }
}
We recommend using a separate phone number for the WhatsApp channel to prevent the bot from responding to your daily messages. If you use your personal phone number, you can enter a prompt in an OpenClaw conversation to enable selfChatMode. In this mode, the bot responds only to messages you send to yourself, without affecting other chats.

Step 3: Link WhatsApp

  1. Run the following command to start the WhatsApp linking process. A QR code is displayed in the terminal.
openclaw channels login --channel whatsapp
  1. Open WhatsApp on your phone and scan the QR code in the terminal to complete the linking process.
  2. Restart the gateway.
openclaw gateway restart

Step 4: Test

  1. Run the following command to check the WhatsApp channel status:
openclaw status
In the Channels section, WhatsApp should be ON with a status of OK.
  1. In WhatsApp, send a message to yourself to verify that the bot responds correctly.

Use cases

Use case 1: Automating X (Twitter)

You can use OpenClaw to automate your X (Twitter) account, letting you create posts, reply to posts, search, and browse your timeline.
  1. Run the following command in your terminal to install twitter-cli.
uv tool install twitter-cli
  1. Enter the following prompt in an OpenClaw conversation to automatically install the Skill.
Install this skill: https://github.com/public-clis/twitter-cli
  1. Once the installation is complete, return to the terminal and restart the gateway to activate the Skill.
openclaw gateway restart
  1. Verify the Skill installation.
openclaw skills list
  1. twitter-cli uses browser cookies for authentication. Ensure you are signed in to x.com in a supported browser (Chrome, Edge, Firefox, Arc, or Brave). twitter-cli will automatically extract your cookies. Alternatively, you can manually set authentication credentials using environment variables:
export TWITTER_AUTH_TOKEN="your_auth_token"
export TWITTER_CT0="your_ct0_token"
To get your cookies, open x.com in your browser and open the developer tools. In the Application panel, find the values for auth_token and ct0 under Cookies.
In an OpenClaw conversation, enter Check Sam Altman's recent posts, summarize the key points, and then help me publish a post with my take on it. OpenClaw will automatically fetch the latest updates, analyze the content, and publish the post.

Use case 2: YouTube video analysis and download

With OpenClaw, you can search for YouTube videos by keyword, sort them by date, retrieve video metadata in batches, and download them.
  1. Run the following command in your terminal to install yt-dlp.
pip install yt-dlp
  1. Verify the installation.
yt-dlp --version
  1. (Optional) Configure cookie authentication. To access age-restricted, members-only, or private videos, configure YouTube cookies. Ensure you are signed in to youtube.com in your browser, then enter the following prompt in an OpenClaw conversation:
I need to configure YouTube cookie authentication. Please use yt-dlp to extract the YouTube cookie from my browser.
After installation, you can use it directly in an OpenClaw conversation. OpenClaw automatically calls the yt-dlp command to perform video-related operations.
In an OpenClaw conversation, enter Help me summarize the main content of this video: https://www.youtube.com/watch?v=XRgGFQ0EgM0. OpenClaw will extract the video information and generate a summary.
In an OpenClaw conversation, enter Help me download this video: https://www.youtube.com/watch?v=XRgGFQ0EgM0. OpenClaw will call yt-dlp to download the video to your local machine.

Use case 3: Scheduling AI news delivery

Use the OpenClaw cron job feature to automatically fetch the latest AI news and send it to WhatsApp daily.
  1. Run the following command in your terminal:
openclaw cron add \
  --name "ai-daily-news" \
  --cron "0 9 * * *" \
  --tz "UTC" \
  --message "Please visit https://techcrunch.com/category/artificial-intelligence/ to get today's AI news. Summarize the top 10 most important AI stories in a concise list format, each with a title and a one-sentence summary in English." \
  --channel whatsapp \
  --to "<your_phone_number>" \
  --announce
The following table describes the parameters.
ParameterDescription
--nameA unique name for the cron job.
--cronThe schedule in cron expression format. For example, "0 9 * * *" runs the job daily at 09:00.
--tzThe time zone for the schedule, such as "UTC", "America/New_York", or "Europe/London".
--messageThe prompt sent to the agent, which specifies what content to fetch and how to summarize it.
--channelThe channel for delivering the result, such as whatsapp.
--announceAnnounces the result in the specified channel.
--toThe recipient's WhatsApp phone number. Use E.164 format: a plus sign (+), country code, and phone number.
On successful creation, the command returns the cron job's information in JSON format, including its task ID and next run time.
  1. After creating the cron job, you can trigger a manual run to verify that it works correctly.
    1. List the cron jobs to get the task ID.
openclaw cron list
  1. Manually trigger the job.
openclaw cron run <task_ID> --timeout 120000
  1. Check the job's execution status.
openclaw cron runs --id <task_ID>
If the output includes "status": "ok" and "delivered": true, this indicates that the news was delivered successfully to WhatsApp.

Use case 4: Stock market monitoring and analysis

Use OpenClaw to analyze stock trends and get technical analysis and investment advice.
AI-generated content is for reference only and does not constitute investment advice or a basis for decision-making.
  1. Install the Skill. Enter the following prompt in an OpenClaw conversation, and OpenClaw will automatically complete the installation:
Install the manus-stock-analysis skill
  1. Once the installation is complete, return to the terminal and restart the gateway to activate the Skill.
openclaw gateway restart
Verify the Skill installation.
openclaw skills list
  1. In an OpenClaw conversation, ask a stock market-related question, such as Analyze NVDA stock.

Learn more

Skill

A skill is an extensible capability module. The agent automatically matches and loads the appropriate skill for a given request. OpenClaw lets you view and enable built-in skills, install community skills from ClawHub, or create custom skills.

View existing skills

  1. Run the following commands to view your installed skills and their status.
# List installed skills
openclaw skills list

# Check skill status (enabled, disabled, missing dependencies, etc.)
openclaw skills check

# View details for a specific skill
openclaw skills info <skill-name>
  1. Built-in skills are disabled by default. To enable built-in skills, add them to the skills.allowBundled whitelist in your ~/.openclaw/openclaw.json file. OpenClaw loads only the built-in skills listed in this whitelist.
{
  "skills": {
    "allowBundled": [
      "github",
      "weather",
      "summarize",
      "coding-agent",
      "clawhub",
      "nano-pdf",
      "google-web-search",
      "image-lab"
    ]
  }
}
Some built-in skills require a third-party API key. Configure these keys in the skills.entries section of your ~/.openclaw/openclaw.json file. For details, refer to the Skills configuration documentation.

Find more skills

Use one of the following methods to find and install more skills.
  1. 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.
# Search by keyword
npx clawhub search [keyword]

# Browse recently updated skills
npx clawhub explore
Once you find a suitable skill, run the following command to install it. After installation, restart the gateway to use the skill.
npx clawhub install <skill-name>
  1. Ask OpenClaw directly Describe what you need directly in the conversation, for example: Help me find a skill that can check the weather. OpenClaw will automatically search for and install a matching skill.

Create a custom skill

  1. Create a directory for your skill.
mkdir -p ~/.openclaw/workspace/skills/my-custom-skill
  1. In this directory, create a SKILL.md file. The file consists of two parts: YAML front matter and Markdown instructions. The name and description fields are required. The agent uses the description to determine whether to load the skill, so ensure it is accurate.
---
name: my-custom-skill
description: A short description
---

# My Custom Skill

When the user requests XXX, perform the following actions:

1. Use the bash tool to run the xxx command
2. Parse the output
3. Return the result to the user in a table
  1. Restart the gateway to activate the skill.
# Restart the gateway
openclaw gateway restart

# Verify the skill is available
openclaw skills list
For more information about Skill configuration, see OpenClaw official documentation.

FAQ

In your terminal, run openclaw tui to open the OpenClaw command line. Then, enter /model to view the model list. Press Enter to select a model and Esc to exit the list.
Check the following potential causes in order:
  1. Incorrect OpenClaw configuration An incorrect Base URL or model provider configuration can cause requests to be routed to a generic API instead of the dedicated channel for Token Plan, triggering the rate limit.
    • If you are using a Token Plan plan, verify that the models, agents, and gateway fields (including nested fields) in your OpenClaw configuration file match the configuration provided in the documentation. For example, the structure for the model provider is { "models": { "providers": { "bailian": {...} } } }.
    • If you are not currently using a Token Plan plan, we recommend switching to one for a dedicated quota.
  2. You may have exceeded your plan's quota. Check your plan's usage on the Token Plan page.
  3. Try resetting your API key: If the issue persists after the steps above, go to the Token Plan page to reset it.
Possible causes include:
  1. The API key is invalid, expired, empty, incorrectly formatted, or does not match the endpoint environment. Verify that the API key is the one designated for your Token Plan plan. Ensure that you have copied the entire key without any extra spaces and that your subscription is active.
  2. An outdated OpenClaw configuration is cached, causing an error. To fix this, delete the providers configuration in the ~/.openclaw/agents/main/agent/models.json file and restart OpenClaw.
Do not overwrite the entire configuration file. Doing so will erase your custom configurations. Instead, make partial changes.Use one of the following methods:
  • If OpenClaw is working correctly: Enter the following prompt in an OpenClaw conversation to merge the configurations.
  • If OpenClaw has no model configured or is not working: Follow the instructions in Guided configuration.
Please integrate Token Plan in OpenClaw by following these steps:
1. Open the configuration file: ~/.openclaw/openclaw.json
2. Find or create the following fields and merge the configuration. This preserves existing configurations and adds new fields if they do not exist.
{
  "models": {
    "mode": "merge",
    "providers": {
      "bailian": {
        "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
        "apiKey": "YOUR_API_KEY",
        "api": "openai-completions",
        "models": [
          {
            "id": "qwen3.6-plus",
            "name": "qwen3.6-plus",
            "reasoning": false,
            "input": ["text", "image"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 1000000,
            "maxTokens": 65536,
            "compat": {
              "thinkingFormat": "qwen"
            }
          },
          {
            "id": "MiniMax-M2.5",
            "name": "MiniMax-M2.5",
            "reasoning": false,
            "input": ["text"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 196608,
            "maxTokens": 32768
          },
          {
            "id": "glm-5",
            "name": "glm-5",
            "reasoning": false,
            "input": ["text"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 202752,
            "maxTokens": 16384,
            "compat": {
              "thinkingFormat": "qwen"
            }
          },
          {
            "id": "deepseek-v3.2",
            "name": "deepseek-v3.2",
            "reasoning": false,
            "input": ["text"],
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "contextWindow": 163840,
            "maxTokens": 16384,
            "compat": {
              "thinkingFormat": "qwen"
            }
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "bailian/qwen3.6-plus"
      },
      "models": {
        "bailian/qwen3.6-plus": {},
        "bailian/MiniMax-M2.5": {},
        "bailian/glm-5": {},
        "bailian/deepseek-v3.2": {}
      }
    }
  },
  "gateway": {
    "mode": "local"
  }
}
3. Save the configuration file.
4. Run openclaw gateway restart to restart the OpenClaw gateway and apply the configuration.
After completing the configuration, start a new OpenClaw session and run the following command to verify the changes: openclaw models status.
Restarting the gateway may cause existing sessions to fail. Start a new session.
The full error message is:
http://127.0.0.1:18791/15:05:56 [ws] closed before connect conn=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1008 reason=device identity required
Cause:The client did not provide a device identity when it connected to the gateway. This typically occurs for one of the following reasons:
  • You have accessed the address in your browser for the first time and have not completed device pairing.
  • The browser cache was cleared, and the device key was lost.
  • After reinstalling or upgrading OpenClaw, the key file in the ~/.openclaw/identity/ directory is missing.
Solution:Run the following commands in your terminal to approve the current device and regenerate the browser access address:
openclaw devices approve --latest
openclaw dashboard --no-open
If the issue persists, clear the pending device records and try again:
openclaw devices clear --pending --yes
openclaw dashboard --no-open
Run openclaw devices list. Verify that your device appears in the "Paired" list. This confirms a successful pairing.
For more information, see the FAQ.