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).
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)
Node.js 22.22.3+, 24.15+, or 25.9+ (Node 24 is the official default target and the recommended choice).
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
openclaw onboard
Answer in order:
Set the Gateway to local mode:
openclaw config set gateway.mode local
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.)
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.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
source ~/.zshrc or reopen the terminal. (On Linux: source ~/.bashrc.)Update:
openclaw update
# or: npm update -g openclaw
Security audit:
openclaw security audit --deep
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.)
~/.openclaw/openclaw.json (the same directory also holds state/, logs/, etc.)
Official docs: https://docs.openclaw.ai