Skip to content

OpenClaw Configuration ​

http
OpenClaw is an open-source personal AI assistant platform that enables interaction with AI through various messaging channels. It can be configured to access AI models on the Token Switch platform.

1. Install OpenClaw ​

OpenClaw requires Node.js version 22.19.0 or higher. You can check the Node.js version using the following command:

http
node --version

If it is not installed or the version is too low, please visit the official website of Node.js to download and install it.

Windows install ​

  • Original Windows PowerShell installation. Execute in PowerShell:
http
iwr -useb https://openclaw.ai/install.ps1 | iex
  • Or install globally via npm:
http
npm install -g openclaw@latest
  • Or through the internal installation within WSL2
  1. <span style="color: rgb(143,149,158); background-color: inherit">First, install WSL2 和 Ubuntu</span> <span style="color: rgb(143,149,158); background-color: inherit">Refer to the official Microsoft website:</span><span style="color: rgb(143,149,158); background-color: inherit">https://learn.microsoft.com/windows/wsl/install</span>

  2. <span style="color: rgb(143,149,158); background-color: inherit">After entering the Ubuntu terminal of WSL, install OpenClaw</span>

http
 curl -fsSL https://openclaw.ai/install.sh | bash
  • Execute the initialization command
http
 openclaw onboard --install-daemon

macOS install ​

http
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon

2. Configuration Wizard ​

After the first installation, OpenClaw will automatically start the configuration wizard to complete the initial setup. Alternatively, you can manually execute the "openclaw onboard" command for configuration.

Configuration itemSuggested configuration
I understand this is powerful and inherently risky. Continue?Choice Yes
Onboarding modeChoice QuickStart
Model/auth providerChoice Skip for now(Configure the model later)
Filter models by providerChoice All providers
Default modelChoice Keep current
Select channel (QuickStart)Choice Skip for now(Configure the channel later)
Configure skills now? (recommended)Choice No
Enable hooks?Press the space bar to select the option, and then press the enter key to proceed to the next step.
How do you want to hatch your bot?Choice Do this later

3. Configuration Steps ​

Assuming you have already installed OpenClaw, you need to configure Token Switch as a model provider in OpenClaw. Refer to the steps below:

3.1 方式一:Terminal mode ​

  1. Open the configuration file
http
nano ~/.openclaw/openclaw.json
  1. Write configuration

Initial configuration: Copy the following content to the configuration file and replace "YOUR_API_KEY" with the Token Switch Pro API Key.

Existing configuration: If you wish to retain the existing configuration, please do not perform a complete replacement. For details on how to safely modify the existing configuration, please refer to the relevant section.

json
{
  "meta": {
    "lastTouchedVersion": "2026.2.1",
    "lastTouchedAt": "2026-02-03T08:20:00.000Z"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "token-switch": {
        "baseUrl": {{apiUrl}},
        "apiKey": "YOUR_API_KEY",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "qwen3.7-max",
            "name": "qwen3.7-max",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 1000000,
            "maxTokens": 65536,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
            "compat": { "thinkingFormat": "openai" }
          },
          {
            "id": "MiniMax-M2.5",
            "name": "MiniMax-M2.5",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 204800,
            "maxTokens": 131072,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "qwen3.7-max"
      },
      "models": {
        "qwen3.7-max": {},
      }
    }
  },
  "gateway": {
    "mode": "local",
    "auth": { "mode": "none" }
  }
}

3.2 方式二:Web UI 方式 ​

If you want to initialize / reset the entire OpenClaw configuration, use the following command:

json
openclaw onboard

If you want to quickly modify the configuration based on existing settings, use the following command:

json
openclaw config

On the configuration selection page, select Model:

On the provider selection page, select Custom Provider:

Enter the Token Switch address at BaseURL: https://neolink.com/api/v1

Select to enter the API key now:

If you are adding Claude series models, it is recommended to select Anthropic-compatible

If you are adding GPT, Gemini, Grok, and other series models, it is recommended to select OpenAI-compatible

If you are using other models or unsure about the model endpoint, select Unknown (detect automatically):

Finally, find the desired model in the "Portal / Model Marketplace", click the model card to copy its Model ID, then enter that Model ID back in OpenClaw — a success prompt means the configuration is complete.

4. Common Issues ​

Bot does not respond in Feishu conversation after configuration ​

Solution: The OpenClaw BaseURL configuration must include v1: https://neolink.com/api/v1

Returns 400 after entering Model ID for configuration ​

Cause: OpenClaw sends a verification message to the model to determine its status:

json
{
  "max_completion_tokens": 1,
  "messages": [
    {"content": "Hi", "role": "user"}
  ],
  "model": "gpt-5.2"
}

OpenClaw sets max_completion_tokens=1, some models do not allow such a small value and will directly refuse to generate, returning 400

Solution: Select Change model, use GPT-4o, which has no max_tokens limitation:

If you still want to use the new GPT model, edit the configuration file ~/.openclaw/openclaw.json to directly configure skipping verification: