• Home
  • Search
  • AI Services
  • Models
  • Writing
  • Multimedia Creation
  • Translation & Others
Homeβ€ΊDeveloper Centerβ€ΊOpenClaw Linux

OpenClaw Linux

API DocumentationAPI Quick StartOpenAI 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 Chat API GuideMYAI168 MCP CLIMYAI168 MCP Web & App
User GuidesGT Agent GuideAI Services Guide
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 5.5 (with gpt-6.1-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-5-5 (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 credit limit for this API key on the Developer API Key page.

Prerequisites

Node.js 24.16+ or 26.1+ (Node 26 is recommended; the official install script installs Node automatically if it is missing). If you install with npm instead, npm 11.16+ or npm 12 needs --allow-scripts=openclaw appended to the install command (npm 12 blocks package install scripts by default).

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 Messages (not the default OpenAI Completions)
    • API Endpoint: https://www.myai168.com/en/api/anthropic (without /v1)
    • API Key: your MYAI168 key
    • Model Configuration: click "Add Model" and set Model ID to claude-opus-5-5
  4. Click "Add" to save. Back in the list, if the card shows a green "Add" button, click it to write the provider into the OpenClaw config file (the button turns into "Remove"); then click "Set Default" to make claude-opus-5-5 the default model.

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-5-5",
                    "name": "claude-opus-5-5", "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-5-5), 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".
  • 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; if you edit the config file by hand, change agents.defaults.model.primary.
6. Maintenance

Update:

openclaw update
# npm installs can also use: npm install -g openclaw@latest

Security audit:

openclaw security audit --deep

Rotate the API Key

Edit the card in cc-switch, update the API Key and save; if you edit the config file by hand, 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

Advanced settings and useful commands

Everything below is optional; the config file is ~/.openclaw/openclaw.json, and openclaw config validate checks it after you edit.

Without cc-switch: one command

This single line creates the Claude provider, makes it the default model and also writes the local Gateway settings such as gateway.mode (copy the whole line and replace "your-key" with your real key):

openclaw onboard --non-interactive --accept-risk --skip-health --auth-choice custom-api-key --custom-provider-id "myai168-claude" --custom-base-url "https://www.myai168.com/en/api/anthropic" --custom-model-id "claude-opus-5-5" --custom-api-key "your-key" --custom-compatibility anthropic

--accept-risk acknowledges that agents have full system access (required in non-interactive mode). Afterwards run openclaw models list and check that the model carries the default tag.

Add a GPT model (OpenAI-compatible endpoint)

Copy the whole line (replace "your-key" with your real key); it only adds this provider and leaves everything else untouched:

openclaw config set models.providers.myai168 '{"baseUrl":"https://www.myai168.com/en/api/openai/v1","apiKey":"your-key","api":"openai-completions","models":[{"id":"gpt-6.1-sol","name":"GPT-6.1 Sol","input":["text","image"],"contextWindow":200000,"maxTokens":32000}]}' --strict-json --merge

Fallback models

When the primary model fails, OpenClaw tries the models in fallbacks in order. Add this under agents.defaults.model in the config file (after setting up the GPT model above):

agents: {
  defaults: {
    model: {
      primary: "myai168-claude/claude-opus-5-5",
      fallbacks: ["myai168/gpt-6.1-sol"]
    }
  }
}

Image input

If the Input column of openclaw models list shows only text, attached images are not passed to the model; add input: ["text", "image"] to that model's entry in the config file so it can see images.

Model for background chores

Light jobs such as generating session titles use the main model by default. To use another configured model (a cheaper one, for example), run the command below with a "provider/model" value:

openclaw config set agents.defaults.utilityModel "myai168/gpt-6.1-sol"

Response timeout

If long answers get cut off, extend the wait for that provider (seconds):

openclaw config set models.providers.myai168-claude.timeoutSeconds 600

Keep the Gateway running in the background

openclaw gateway install
openclaw gateway status
openclaw dashboard

gateway install installs the Gateway as a background service (on Linux it is installed as a systemd user unit); gateway status should show it listening on port 18789; openclaw dashboard opens the web UI in your browser.

Connect MYAI168 MCP

To let OpenClaw use this site's AI modules as tools, see the "OpenClaw" section of the MYAI168 MCP CLI page.

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

Other FAQ pages

API Documentation

  • API Quick Start
  • 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 Chat API Guide
  • MYAI168 MCP CLI
  • MYAI168 MCP Web & App

User Guides

  • GT Agent Guide
  • AI Services Guide