Skip to main content
Use the one-click installer to deploy OpenClaw on Linux or macOS with Crazyrouter as the default backend. The installer writes a ready-to-run ~/.openclaw/openclaw.json, registers the system service, and preloads a practical model set for chat, coding, and long-context work.

Overview

OpenClaw is a good fit when you want a self-controlled local AI entrypoint backed by Crazyrouter:
  • local WebUI and gateway, default port 18789
  • reusable access to your Crazyrouter models and quota
  • Telegram support out of the box, plus pre-enabled plugin entries for DingTalk, WeCom, QQ Bot, Discord, Slack, and Feishu
  • a good match for persistent personal bots, internal team assistants, home servers, and light self-hosted deployments

Best For

  • connecting Crazyrouter to a local AI gateway with one command
  • running a Telegram bot on your own server
  • managing WebUI, chat, and IM entrypoints in one place
  • keeping an always-on assistant on a dev box or home mini server

Protocol Used

Recommended protocol: OpenAI-compatible API
  • the installer points the default crazyrouter provider at https://crazyrouter.com/v1
  • it also writes crazyrouter-claude and crazyrouter-minimax providers for native-compatible switching
  • OpenClaw itself exposes a local gateway and WebUI, authenticated with the generated gateway.auth.token

Prerequisites

ItemNotes
Crazyrouter accountCreate one at crazyrouter.com
Crazyrouter API keyCreate a dedicated sk-... token for OpenClaw instead of reusing your IDE or CLI tokens
OSLinux or macOS, x64 / arm64
NetworkThe host needs outbound internet access; if you want remote WebUI access, allow the chosen gateway port
Node.jsThe installer tries to install Node.js 22+ for you
Telegram bot tokenOptional, only needed if you want Telegram
The installer binds the gateway to LAN scope by default (bind: lan). If the machine is reachable from the public internet, protect it with firewall rules and keep the gateway login token private.

Quick Start In 5 Minutes

1

Create a dedicated Crazyrouter token

In Crazyrouter, create a dedicated sk-... token for OpenClaw. Start with a small model allowlist such as claude-sonnet-4-6, gpt-5.4, and gemini-3-pro-preview.
2

Run the installer

curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash
To skip the language picker and API key prompt:
CRAZYROUTER_API_KEY=sk-xxx INSTALLER_LANG=en \
  curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash
3

Save the 3 values printed by the installer

  • WebUI URL: http://<server-ip>:18789
  • auto-login URL: http://<server-ip>:18789?token=<gateway_token>
  • config path: ~/.openclaw/openclaw.json
4

Validate the first successful response

Open the auto-login URL in a browser, confirm you can enter the OpenClaw control UI, and send a simple test prompt with the default model claude-sonnet-4-6, such as Reply with ok.
5

Optionally finish Telegram pairing

The installer can set up Telegram immediately. If you choose that path, paste your Bot Token and then send any message to the bot so the first owner pairing can complete.
The installer sets claude-sonnet-4-6 as the default primary model. To change the day-to-day default, edit agents.defaults.model.primary in ~/.openclaw/openclaw.json.
Use caseRecommended modelWhy
Default daily assistantclaude-sonnet-4-6Strong balance of quality, stability, and cost
Coding / agent workgpt-5.4Verified successfully in production on March 23, 2026, and suited for the main OpenAI-compatible coding and agent baseline
Highest answer qualityclaude-opus-4-6Stronger complex reasoning and writing quality
Gemini fallback pathgemini-3-pro-previewUseful as a second compatibility-validation path
Heavy reasoningdeepseek-r1Useful when you want stronger reasoning behavior
Example: switch the default model to gpt-5.4
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "crazyrouter/gpt-5.4"
      }
    }
  }
}
If you want to explicitly use the Claude-compatible provider instead:
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "crazyrouter-claude/claude-sonnet-4-6"
      }
    }
  }
}

Token Setup Best Practices

SettingRecommendationNotes
Dedicated tokenRequiredDo not reuse the same token across OpenClaw, Cursor, and CLI tools
Model allowlistRecommendedKeep only the models OpenClaw should use
IP restrictionRecommended on fixed-egress serversRestrict the token to the server IP when possible
Quota capRecommendedGive the bot its own daily or monthly budget
Environment splitRecommendedUse separate tokens for production bots and test bots
Leak responseImmediate rotationIf openclaw.json, logs, or shared links expose credentials, rotate both the Crazyrouter token and gateway token
OpenClaw uses at least two credential types: the Crazyrouter sk-... API key for model calls, and the local gateway login token for WebUI access. Keep them separate.

Verification Checklist

  • http://<server-ip>:18789?token=<gateway_token> opens successfully
  • the WebUI signs in without looping back to login
  • the default model returns the first response successfully
  • after a model change, a service restart still works
  • journalctl --user -u openclaw -f or tail -f ~/.openclaw/openclaw.log shows successful requests
  • if Telegram is enabled, the bot can reply to a test message
  • a backup of ~/.openclaw/openclaw.json is saved

Key Files And Config Fields

File Locations

PathPurpose
~/.openclaw/openclaw.jsonmain config file
~/.openclaw/start-gateway.shlauncher script used by the service
~/.openclaw/crash-guard.cjsstability patch written by the installer
~/.openclaw/credentials/.telegram-owner-pairedmarker file created after the first Telegram owner is paired
~/.config/systemd/user/openclaw.serviceLinux user-level systemd service
~/Library/LaunchAgents/com.crazyrouter.openclaw.plistmacOS launchd service
~/.openclaw/openclaw.logmacOS runtime log
~/.openclaw/openclaw.errmacOS error log

Most Common Config Fields

JSON pathPurposeTypical change
models.providers.crazyrouter.apiKeyCrazyrouter OpenAI-compatible keyrotate API key
models.providers.crazyrouter.baseUrlOpenAI-compatible base URLusually keep https://crazyrouter.com/v1
agents.defaults.model.primarydefault primary modelswitch to gpt-5.4, claude-opus-4-6-thinking, and so on
gateway.portWebUI / gateway portmove to a different port
gateway.auth.tokenWebUI login tokenrotate immediately if exposed
gateway.bindlistener scopedefault is lan
channels.telegram.botTokenTelegram Bot Tokenfill this when enabling Telegram
plugins.entries.*.enabledwhether each IM plugin is enableddisable unused plugins
env.vars.OPENAI_API_KEYAPI key reused by some internal capabilitiesusually keep it aligned with the main key

IM Integrations

Telegram

Telegram is the most complete path supported by the installer and should be your first integration:
  1. Open Telegram and search for @BotFather
  2. Send /newbot and create your bot
  3. When the installer asks Set up Telegram Bot now?, choose Y
  4. Paste the Bot Token so the installer can write it into ~/.openclaw/openclaw.json
  5. After the installer restarts the gateway, send any message to the bot
  6. The first sender is auto-paired as the owner
  7. If auto-pairing fails, run:
openclaw pairing list
openclaw pairing approve <code>
If you need to add Telegram manually later, this is the structure the installer writes:
{
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "123456789:ABCdef...",
      "dmPolicy": "pairing",
      "groupPolicy": "allowlist",
      "streaming": "off"
    }
  },
  "plugins": {
    "entries": {
      "telegram": { "enabled": true }
    }
  }
}

Other IM Platforms

The installer pre-enables plugin entries for:
  • dingtalk
  • openclaw-wecom
  • qqbot
  • discord
  • slack
  • feishu
Those channels usually still require you to add your own platform credentials and the matching channels.<name> config. A safe rollout pattern is:
  1. create the bot or app in the target platform
  2. write the platform credentials into ~/.openclaw/openclaw.json
  3. confirm plugins.entries.<name>.enabled is true
  4. restart the OpenClaw service
  5. validate the channel by checking logs and sending a test message
PlatformInstaller stateWhat you still need to do
Telegraminteractive setup supportedprovide Bot Token and complete owner pairing
DingTalkplugin installs and is enabledadd robot credentials and channel config
WeComplugin installs and is enabledadd enterprise app credentials and channel config
QQ Botplugin installs and is enabledadd bot credentials and channel config
Discord / Slack / Feishuplugin entry is enabledadd the platform-specific channel credentials
If OpenClaw will be connected to a team IM workspace, create a separate Crazyrouter token for that bot and enforce a tighter model allowlist and quota cap.

Service Management And Logs

systemctl --user status openclaw
systemctl --user start openclaw
systemctl --user restart openclaw
systemctl --user stop openclaw
journalctl --user -u openclaw -f
The installer also attempts loginctl enable-linger $(whoami) so the user-level service can keep running after you disconnect your SSH session.

Performance And Cost Tips

  • start with claude-sonnet-4-6 until the whole flow is stable
  • keep routine bot traffic on claude-sonnet-4-6 or move selected tasks to gemini-3-pro-preview
  • use gpt-5.4 for coding-heavy agent workflows
  • split WebUI, Telegram, and team IM usage across different tokens for better cost tracking
  • keep only the models and plugins you actually need

Upgrade Guide

The safest upgrade path is to rerun the installer, because it refreshes the OpenClaw package, patches, and service script together:
1

Back up the current config

cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak
2

Run the installer again

curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash
3

Re-check custom settings

If you manually added non-Telegram channels or changed the default model, compare the updated openclaw.json with your backup and re-apply the custom sections if needed.
4

Restart and verify

Open the WebUI again and confirm your models, logs, and IM channels still work.
If you intentionally want to upgrade only the OpenClaw npm package, you can run npm install -g openclaw@latest and then restart the service, but that path will not re-apply installer-managed patches and script updates.

Uninstall Guide

systemctl --user disable --now openclaw
rm -f ~/.config/systemd/user/openclaw.service
systemctl --user daemon-reload
rm -rf ~/.openclaw
npm uninstall -g openclaw
If Node.js was installed only for OpenClaw, you can remove Node.js afterward once you confirm nothing else on the machine depends on it.

Common Errors And Fixes

SymptomLikely causeFix
WebUI does not openservice is down, port is busy, or firewall is blocking accesscheck service state first, then verify port 18789 and firewall rules
The page opens but keeps asking for loginwrong gateway.auth.token or not using the auto-login URLre-check the ?token=... link printed by the installer and confirm openclaw.json
401 unauthorizedinvalid or expired Crazyrouter API key in models.providers.*.apiKeyupdate the API key and restart the service
403 or model not allowedthe requested model is not allowed by the Crazyrouter tokenadd that model to the token allowlist
429 or quota exhaustionbudget or rate limit reachedraise the budget, switch to a cheaper model, or split traffic across tokens
The old model is still used after editing configservice was not restarted or the provider path is wrongcheck agents.defaults.model.primary, then restart
Telegram bot does not replymissing botToken, owner pairing never completed, or service was not restartedcheck channels.telegram, restart, and trigger pairing again
Linux install says the service may not have starteduser-level systemd service failedinspect journalctl --user -u openclaw -f
macOS install says the service may not have startedlaunchd startup failedinspect ~/.openclaw/openclaw.err

FAQ

Which Crazyrouter base URL should I keep?

Leave the installer defaults unless you are intentionally changing provider modes: https://crazyrouter.com/v1 for the OpenAI-compatible provider, and https://crazyrouter.com for Claude / MiniMax native-compatible providers.

Which default model should I keep first?

For most users, keep claude-sonnet-4-6 first. If OpenClaw is mainly a coding assistant, switch to gpt-5.4.

Why is my expected model missing?

Usually the model is not allowed by the Crazyrouter token, or the config is pointing at the wrong provider prefix.

Why does Telegram work in DM but not in groups?

The installer sets Telegram group policy to allowlist by default. Adjust the Telegram channel config if your rollout needs broader group behavior.

What is the safest way to expose OpenClaw externally?

At minimum: restrict inbound access, protect gateway.auth.token, and use a dedicated Crazyrouter token for OpenClaw. If the host is public, add a reverse proxy and extra access control.

View the installer repository

Review the installer source, file issues, or audit the one-click setup yourself.