Homeβ€ΊDeveloper Centerβ€ΊOpenClaw Linux

OpenClaw Linux

API DocumentationOpenAI ChatGPT APIAnthropic (Claude) APIGoogle Gemini APIGoogle Search APIGoogle News APIOpenRouter APIAPI Pricing
CLI & Agent Guidescc-switch macOScc-switch Windowscc-switch LinuxOpenCode macOSOpenCode WindowsOpenCode LinuxOpenClaw macOSOpenClaw WindowsOpenClaw LinuxHermes Agent macOSHermes Agent WindowsHermes Agent LinuxClaude Code CLI macOSClaude Code CLI WindowsClaude Code CLI LinuxCodex CLI macOSCodex CLI WindowsCodex CLI Linux
MYAI168 API & MCPMYAI168 MCP CLIMYAI168 MCP Web & App
No matching questions on this page.Search the whole site
Installation Overview (Linux)

OpenClaw Installation and MYAI168 Setup Guide β€” Linux

Goal of this guide: install OpenClaw (an open-source AI agent that runs on your own machine, nicknamed the "lobster" 🦞) on a Linux desktop and connect it to your own MYAI168 API, using Claude Opus 4.8 (with gpt-5.6-sol as an optional backup).

On Linux desktop, configuring the lobster with the cc-switch GUI has been verified to work (settings are written successfully). (Prerequisite: cc-switch is installed β€” for installation, see the "cc-switch Linux" page in the Developer Center.)

Endpoints and Model

Anthropic native endpoint    https://www.myai168.com/en/api/anthropic
OpenAI-compatible endpoint   https://www.myai168.com/en/api/openai/v1
Main model                   claude-opus-4-8 (via the Anthropic endpoint)

Important Security Notes

  • The lobster has very broad system permissions (reading files, running commands, sending messages, browsing the web). Do not install it on a primary machine holding lots of sensitive data; if possible use a dedicated machine or a clean account.
  • Do not expose the admin console (Control UI) to the public internet; keep it on localhost or behind a Tailscale / SSH tunnel.
  • Always install the latest version (older versions had serious security vulnerabilities).
  • Early token usage can be high; set a usage cap in the MYAI168 dashboard.

Prerequisites

Node.js 22.22.3+, 24.15+, or 25.9+ (Node 24 is the official default target and the recommended choice).

0.5 Prerequisites: Node.js and Shell

Check Node:

node --version

If missing, install (Ubuntu / Debian):

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

If it conflicts with the distro's old built-in Node (libnode-dev), remove that first and install again:

sudo apt-get remove -y libnode-dev
sudo apt-get install -y nodejs

Check your shell:

echo $SHELL

Ends with /bash β†’ use ~/.bashrc; ends with /zsh β†’ use ~/.zshrc.

1. Install OpenClaw
npm install -g openclaw@latest

Verify:

openclaw --version

If command not found, add the npm global bin directory to PATH:

echo 'export PATH="$PATH:'$(npm config get prefix)'/bin"' >> ~/.bashrc
source ~/.bashrc
2. Configure MYAI168 with cc-switch
  1. Open cc-switch and click the "OpenClaw" tab at the top.
  2. Click "+" to add a provider.
  3. Fill in:
    • Provider Key: myai168-claude (lowercase, hyphen)
    • Provider Name: MYAI168 Claude
    • API Protocol: choose Anthropic (not the default OpenAI Completions)
    • API Endpoint: https://www.myai168.com/en/api/anthropic
    • API Key: your MYAI168 key
    • Models: click "+ Add Model" and set Model ID to claude-opus-4-8
  4. Click "+ Add", then Enable on the card.

cc-switch writes the settings into models.providers of ~/.openclaw/openclaw.json, looking roughly like this (for reference β€” usually no manual editing needed):

"models": {
  "mode": "merge",
  "providers": {
    "myai168-claude": {
      "baseUrl": "https://www.myai168.com/en/api/anthropic",
      "apiKey": "your-key",
      "api": "anthropic-messages",
      "models": [ { "id": "claude-opus-4-8",
                    "name": "claude-opus-4-8", "input": ["text"] } ]
    }
  }
}

(Note: the anthropic baseUrl is .../anthropic, without /v1 β€” OpenClaw's Anthropic client appends /v1 automatically; verified to work.)

Confirm it was written:

cat ~/.openclaw/openclaw.json
3. Initialize with doctor
openclaw doctor

doctor asks a few setup questions; recommended answers:

  • Tighten permissions on ~/.openclaw to 700? β†’ Yes
  • Update gateway service config to recommended defaults? β†’ Yes
  • Disable unavailable skills? β†’ Yes (disabling tools your environment does not have keeps things clean)
  • Enable bash shell completion? β†’ Yes
4. Verify and Launch

Confirm the models were loaded:

openclaw models list

You should see your models, with yes in the Auth column and the main model tagged default / configured. (If a claude-cli/... entry also appears, it was auto-detected from a local Claude CLI install β€” ignore it.)

Launch test:

openclaw

Once in the chat UI (if the built-in OpenClaw setup agent β€” formerly called Crestodian β€” appears first, it hands you over to the main agent; the status bar at the bottom should show myai168-claude/claude-opus-4-8), ask a math question:

What is 123456 times 789? Reply with the number only.

If it answers 97406784, the connection works. (Do not verify with "who are you" β€” model self-identification is unreliable.)

You can also try chatting in the dashboard (it needs the Gateway running; on a fresh install start it first):

openclaw gateway start
openclaw gateway status     # Runtime: running means it is up
openclaw dashboard      # opens http://127.0.0.1:18789/ in the browser
5. Quick Troubleshooting
  • command not found: openclaw β†’ PATH not in effect. Run source ~/.bashrc (for zsh: source ~/.zshrc) or reopen the terminal; if still not found, see the PATH fix in "1. Install OpenClaw". (On macOS: source ~/.zshrc.)
  • npm ... EACCES β†’ global directory permission problem; point the npm global directory to your home directory (npm config set prefix ~/.npm-global, then add ~/.npm-global/bin to PATH) and reinstall.
  • doctor reports a JSON syntax error (after manually editing openclaw.json) β†’ the editor turned straight quotes into curly quotes. Edit with nano, or disable smart quotes and paste again.
  • model not allowed β†’ the model is not on the allowlist. cc-switch usually takes care of this; if you edited the config manually, add it under agents.defaults.models.
  • Replies fail with model-related errors β†’ the model id or endpoint does not match the provider's actual values; compare and fix.
  • Switch the main model β†’ switch the enabled provider in cc-switch. (For manual setups on macOS: change agents.defaults.model.primary.)
6. Maintenance

Update:

openclaw update
# or: npm update -g openclaw

Security audit:

openclaw security audit --deep

Rotate the API Key

Update the API Key on the cc-switch card and Enable it again. (For manual setups on macOS: update the apiKey in ~/.openclaw/openclaw.json and restart.)

Config File Location

~/.openclaw/openclaw.json (the same directory also holds state/, logs/, etc.)

Official docs: https://docs.openclaw.ai

β€Ή Previous page: OpenClaw WindowsNext page: Hermes Agent macOS β€Ί
↑
Question link copied.

Other FAQ pages

API Documentation

  • OpenAI ChatGPT API
  • Anthropic (Claude) API
  • Google Gemini API
  • Google Search API
  • Google News API
  • OpenRouter API
  • API Pricing

CLI & Agent Guides

  • cc-switch macOS
  • cc-switch Windows
  • cc-switch Linux
  • OpenCode macOS
  • OpenCode Windows
  • OpenCode Linux
  • OpenClaw macOS
  • OpenClaw Windows
  • Hermes Agent macOS
  • Hermes Agent Windows
  • Hermes Agent Linux
  • Claude Code CLI macOS
  • Claude Code CLI Windows
  • Claude Code CLI Linux
  • Codex CLI macOS
  • Codex CLI Windows
  • Codex CLI Linux

MYAI168 API & MCP

  • MYAI168 MCP CLI
  • MYAI168 MCP Web & App