Homeβ€ΊDeveloper Centerβ€ΊOpenClaw macOS

OpenClaw macOS

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 (macOS)

OpenClaw Installation and MYAI168 Setup Guide β€” macOS

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

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).

1. Prerequisites and Installation

Check Node (if missing, brew install node):

node --version

Install the lobster (official script, or via npm if you already have Node):

curl -fsSL https://openclaw.ai/install.sh | bash
# or: npm i -g openclaw@latest

If you hit an npm permission error (EACCES), point the global directory to your home directory:

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
npm install -g openclaw@latest

Verify:

openclaw --version
2. Onboarding
openclaw onboard

Answer in order:

  • Security disclaimer β†’ Yes
  • Setup mode β†’ QuickStart
  • Model/auth provider β†’ Skip for now (we will connect a custom API by editing the config file later)
  • Messaging platforms (Telegram / WhatsApp…) β†’ skip them all
  • Generate gateway token? β†’ Yes
  • Tighten permissions? β†’ Yes
  • Create session store dir? β†’ Yes
  • Disable unavailable skills? β†’ No (keeping them does no harm; they start working once their dependencies are installed)

Set the Gateway to local mode:

openclaw config set gateway.mode local
3. Connect to MYAI168 (edit the config file)
mkdir -p ~/.openclaw
nano ~/.openclaw/openclaw.json

Paste in (replace "your-key" with your real key; use nano so TextEdit does not turn straight quotes into curly quotes and break the JSON):

{
  models: {
    mode: "merge",
    providers: {
      myai168: {
        baseUrl: "https://www.myai168.com/en/api/openai/v1",
        apiKey: "your-key",
        api: "openai-completions",
        models: [
          { id: "gpt-5.6-sol", name: "GPT-5.6 Sol", input: ["text"],
            contextWindow: 200000, maxTokens: 32000 }
        ]
      },
      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"],
            contextWindow: 200000, maxTokens: 32000 }
        ]
      }
    }
  },
  agents: {
    defaults: {
      model: { primary: "myai168_claude/claude-opus-4-8" },
      models: {
        "myai168_claude/claude-opus-4-8": {},
        "myai168/gpt-5.6-sol": {}
      }
    }
  }
}

(In nano: save with Ctrl+O, Enter; exit with Ctrl+X.)

Key Points

  • baseUrl has a lowercase u; the api field takes openai-completions / anthropic-messages.
  • A provider must be defined AND listed in the agents.defaults.models allowlist, otherwise you get model not allowed.
  • primary is the default main model; to default to gpt-5.6-sol, change it to "myai168/gpt-5.6-sol".
  • Set the anthropic endpoint baseUrl to https://www.myai168.com/en/api/anthropic (without /v1) β€” OpenClaw's Anthropic client appends /v1 to the base URL automatically (per the official docs), so adding /v1 yourself produces a duplicated /v1/v1 path that fails.
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:

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 ~/.zshrc or reopen the terminal. (On Linux: source ~/.bashrc.)
  • npm ... EACCES β†’ global directory permission problem; change the prefix to ~/.npm-global (see "1. Prerequisites and Installation").
  • doctor reports a JSON syntax error (after manual editing) β†’ 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; add it under agents.defaults.models. (On Linux, cc-switch usually takes care of this.)
  • 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 β†’ change agents.defaults.model.primary in the config file. (On Linux: switch the enabled provider in cc-switch.)
6. Maintenance

Update:

openclaw update
# or: npm update -g openclaw

Security audit:

openclaw security audit --deep

Rotate the API Key

Update the apiKey in ~/.openclaw/openclaw.json and restart OpenClaw. (On Linux: update the API Key on the cc-switch card and Enable it again.)

Config File Location

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

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

β€Ή Previous page: OpenCode LinuxNext page: OpenClaw Windows β€Ί
↑
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 Windows
  • OpenClaw Linux
  • 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