OpenClaw 是一個開源的個人 AI 助手平台,支援通過多種訊息渠道與 AI 互動。通過配置可接入阿里雲百鍊平台上的 AI 模型,支援隨用隨付、Coding Plan、Token Plan 團隊版三種接入方式。
安裝 OpenClaw
OpenClaw 需要 Node.js 22.19.0 或更高版本。可通過以下命令檢查 Node.js 版本:
node --version
如果未安裝或版本過低,請訪問 Node.js 官網下載安裝。
macOS / Linux
推薦使用官方安裝指令碼:
curl -fsSL https://openclaw.ai/install.sh | bash
或通過 npm 全域安裝:
npm install -g openclaw@latest
Windows
在 PowerShell 中執行:
iwr -useb https://openclaw.ai/install.ps1 | iex
或通過 npm 全域安裝:
npm install -g openclaw@latest
首次安裝後,OpenClaw 會自動啟動設定精靈,完成初始設定。也可以手動執行openclaw onboard命令進行配置。
|
配置項 |
建議配置 |
|---|---|
|
I understand this is powerful and inherently risky. Continue? |
選擇 Yes |
|
Onboarding mode |
選擇 QuickStart |
|
Model/auth provider |
選擇 Skip for now(稍後配置百鍊模型) |
|
Filter models by provider |
選擇 All providers |
|
Default model |
選擇 Keep current |
|
Select channel (QuickStart) |
選擇 Skip for now(稍後配置渠道) |
|
Configure skills now? (recommended) |
選擇 No |
|
Enable hooks? |
按空格鍵選中選項,按斷行符號鍵進入下一步 |
|
How do you want to hatch your bot? |
選擇 Do this later |
配置接入憑證
Token Plan 團隊版
將 YOUR_API_KEY 替換為 Token Plan 團隊版專屬 API Key。可用模型請參考 Token Plan 團隊版支援的模型。
|
API Key |
Token Plan 團隊版專屬 API Key |
|---|---|
|
Base URL |
|
|
可用模型 |
Token Plan 團隊版支援的模型 |
設定檔位於 ~/.openclaw/openclaw.json,OpenClaw 啟動時會自動讀取。
樣本禁用了網關鑒權(auth.mode: none),僅適合單機本地使用。如需共用或遠端存取,請運行 openclaw doctor --fix 啟用 token 鑒權。
方式一:終端方式
-
開啟設定檔
nano ~/.openclaw/openclaw.json -
寫入配置
首次配置:複製以下內容到設定檔,將
YOUR_API_KEY替換為 Token Plan 團隊版 API Key。已有配置:若需保留已有配置,請勿直接全量替換,詳見已有配置如何安全修改。
{ "meta": { "lastTouchedVersion": "2026.2.1", "lastTouchedAt": "2026-02-03T08:20:00.000Z" }, "models": { "mode": "merge", "providers": { "bailian-token-plan": { "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic", "apiKey": "YOUR_API_KEY", "api": "anthropic-messages", "models": [ { "id": "qwen3.7-max", "name": "qwen3.7-max", "reasoning": false, "input": ["text"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.7-plus", "name": "qwen3.7-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.6-plus", "name": "qwen3.6-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.6-flash", "name": "qwen3.6-flash", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 32768, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "deepseek-v4-pro", "name": "deepseek-v4-pro", "reasoning": false, "input": ["text"], "contextWindow": 163840, "maxTokens": 32768, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "deepseek-v4-flash", "name": "deepseek-v4-flash", "reasoning": false, "input": ["text"], "contextWindow": 163840, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "deepseek-v3.2", "name": "deepseek-v3.2", "reasoning": false, "input": ["text"], "contextWindow": 163840, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "kimi-k2.7-code", "name": "kimi-k2.7-code", "reasoning": false, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 32768, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "kimi-k2.6", "name": "kimi-k2.6", "reasoning": false, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "kimi-k2.5", "name": "kimi-k2.5", "reasoning": false, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "glm-5.2", "name": "glm-5.2", "reasoning": false, "input": ["text"], "contextWindow": 1000000, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "glm-5.1", "name": "glm-5.1", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "glm-5", "name": "glm-5", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "MiniMax-M2.5", "name": "MiniMax-M2.5", "reasoning": false, "input": ["text"], "contextWindow": 204800, "maxTokens": 131072, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } } ] } } }, "agents": { "defaults": { "model": { "primary": "bailian-token-plan/qwen3.7-plus" }, "models": { "bailian-token-plan/qwen3.7-max": {}, "bailian-token-plan/qwen3.7-plus": {}, "bailian-token-plan/qwen3.6-plus": {}, "bailian-token-plan/qwen3.6-flash": {}, "bailian-token-plan/deepseek-v4-pro": {}, "bailian-token-plan/deepseek-v4-flash": {}, "bailian-token-plan/deepseek-v3.2": {}, "bailian-token-plan/kimi-k2.7-code": {}, "bailian-token-plan/kimi-k2.6": {}, "bailian-token-plan/kimi-k2.5": {}, "bailian-token-plan/glm-5.2": {}, "bailian-token-plan/glm-5.1": {}, "bailian-token-plan/glm-5": {}, "bailian-token-plan/MiniMax-M2.5": {} } } }, "gateway": { "mode": "local", "auth": { "mode": "none" } } } -
儲存並退出
按
Ctrl+X,按Y確認儲存,按Enter確認檔案名稱。 -
使配置生效
運行以下命令重啟網關,使配置生效。
openclaw gateway restart
方式二:Web UI 方式
-
啟動 Web UI
在終端運行以下命令啟動 Web UI:
openclaw dashboard在瀏覽器開啟的頁面中,單擊左側菜單 設定,將編輯器模式從 Form 切換為 Raw。
-
寫入配置
首次配置:複製以下內容到設定檔,將
YOUR_API_KEY替換為 Token Plan 團隊版 API Key。已有配置:若需保留已有配置,請勿直接全量替換,詳見已有配置如何安全修改。
{ "meta": { "lastTouchedVersion": "2026.2.1", "lastTouchedAt": "2026-02-03T08:20:00.000Z" }, "models": { "mode": "merge", "providers": { "bailian-token-plan": { "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic", "apiKey": "YOUR_API_KEY", "api": "anthropic-messages", "models": [ { "id": "qwen3.7-max", "name": "qwen3.7-max", "reasoning": false, "input": ["text"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.7-plus", "name": "qwen3.7-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.6-plus", "name": "qwen3.6-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.6-flash", "name": "qwen3.6-flash", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 32768, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "deepseek-v4-pro", "name": "deepseek-v4-pro", "reasoning": false, "input": ["text"], "contextWindow": 163840, "maxTokens": 32768, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "deepseek-v4-flash", "name": "deepseek-v4-flash", "reasoning": false, "input": ["text"], "contextWindow": 163840, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "deepseek-v3.2", "name": "deepseek-v3.2", "reasoning": false, "input": ["text"], "contextWindow": 163840, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "kimi-k2.7-code", "name": "kimi-k2.7-code", "reasoning": false, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 32768, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "kimi-k2.6", "name": "kimi-k2.6", "reasoning": false, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "kimi-k2.5", "name": "kimi-k2.5", "reasoning": false, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "glm-5.2", "name": "glm-5.2", "reasoning": false, "input": ["text"], "contextWindow": 1000000, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "glm-5.1", "name": "glm-5.1", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "glm-5", "name": "glm-5", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "MiniMax-M2.5", "name": "MiniMax-M2.5", "reasoning": false, "input": ["text"], "contextWindow": 204800, "maxTokens": 131072, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } } ] } } }, "agents": { "defaults": { "model": { "primary": "bailian-token-plan/qwen3.7-plus" }, "models": { "bailian-token-plan/qwen3.7-max": {}, "bailian-token-plan/qwen3.7-plus": {}, "bailian-token-plan/qwen3.6-plus": {}, "bailian-token-plan/qwen3.6-flash": {}, "bailian-token-plan/deepseek-v4-pro": {}, "bailian-token-plan/deepseek-v4-flash": {}, "bailian-token-plan/deepseek-v3.2": {}, "bailian-token-plan/kimi-k2.7-code": {}, "bailian-token-plan/kimi-k2.6": {}, "bailian-token-plan/kimi-k2.5": {}, "bailian-token-plan/glm-5.2": {}, "bailian-token-plan/glm-5.1": {}, "bailian-token-plan/glm-5": {}, "bailian-token-plan/MiniMax-M2.5": {} } } }, "gateway": { "mode": "local", "auth": { "mode": "none" } } } -
儲存並應用
先單擊 Save 按鈕將配置寫入磁碟,再單擊 Apply 按鈕重啟網關使配置生效。
Coding Plan
將 YOUR_API_KEY 替換為 Coding Plan 專屬 API Key(格式為 sk-sp-xxxxx)。可用模型請參考 Coding Plan 支援的模型。
|
API Key |
Coding Plan 專屬 API Key,格式為 |
|---|---|
|
Base URL |
|
|
可用模型 |
Coding Plan 支援的模型 |
設定檔位於 ~/.openclaw/openclaw.json,OpenClaw 啟動時會自動讀取。
樣本禁用了網關鑒權(auth.mode: none),僅適合單機本地使用。如需共用或遠端存取,請運行 openclaw doctor --fix 啟用 token 鑒權。
方式一:終端方式
-
開啟設定檔
nano ~/.openclaw/openclaw.json -
寫入配置
首次配置:複製以下內容到設定檔,將
YOUR_API_KEY替換為 Coding Plan API Key。已有配置:若需保留已有配置,請勿直接全量替換,詳見已有配置如何安全修改。
{ "meta": { "lastTouchedVersion": "2026.2.1", "lastTouchedAt": "2026-02-03T08:20:00.000Z" }, "models": { "mode": "merge", "providers": { "bailian-coding-plan": { "baseUrl": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic", "apiKey": "YOUR_API_KEY", "api": "anthropic-messages", "models": [ { "id": "qwen3.7-plus", "name": "qwen3.7-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.6-plus", "name": "qwen3.6-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.5-plus", "name": "qwen3.5-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3-max-2026-01-23", "name": "qwen3-max-2026-01-23", "reasoning": false, "input": ["text"], "contextWindow": 262144, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3-coder-next", "name": "qwen3-coder-next", "reasoning": false, "input": ["text"], "contextWindow": 262144, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "qwen3-coder-plus", "name": "qwen3-coder-plus", "reasoning": false, "input": ["text"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "MiniMax-M2.5", "name": "MiniMax-M2.5", "reasoning": false, "input": ["text"], "contextWindow": 204800, "maxTokens": 131072, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "glm-5", "name": "glm-5", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "glm-4.7", "name": "glm-4.7", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "kimi-k2.5", "name": "kimi-k2.5", "reasoning": false, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } } ] } } }, "agents": { "defaults": { "model": { "primary": "bailian-coding-plan/qwen3.7-plus" }, "models": { "bailian-coding-plan/qwen3.7-plus": {}, "bailian-coding-plan/qwen3.6-plus": {}, "bailian-coding-plan/qwen3.5-plus": {}, "bailian-coding-plan/qwen3-max-2026-01-23": {}, "bailian-coding-plan/qwen3-coder-next": {}, "bailian-coding-plan/qwen3-coder-plus": {}, "bailian-coding-plan/MiniMax-M2.5": {}, "bailian-coding-plan/glm-5": {}, "bailian-coding-plan/glm-4.7": {}, "bailian-coding-plan/kimi-k2.5": {} } } }, "gateway": { "mode": "local", "auth": { "mode": "none" } } } -
儲存並退出
按
Ctrl+X,按Y確認儲存,按Enter確認檔案名稱。 -
使配置生效
運行以下命令重啟網關,使配置生效。
openclaw gateway restart
方式二:Web UI 方式
-
啟動 Web UI
在終端運行以下命令啟動 Web UI:
openclaw dashboard在瀏覽器開啟的頁面中,單擊左側菜單 設定,將編輯器模式從 Form 切換為 Raw。
-
寫入配置
首次配置:複製以下內容到設定檔,將
YOUR_API_KEY替換為 Coding Plan API Key。已有配置:若需保留已有配置,請勿直接全量替換,詳見已有配置如何安全修改。
{ "meta": { "lastTouchedVersion": "2026.2.1", "lastTouchedAt": "2026-02-03T08:20:00.000Z" }, "models": { "mode": "merge", "providers": { "bailian-coding-plan": { "baseUrl": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic", "apiKey": "YOUR_API_KEY", "api": "anthropic-messages", "models": [ { "id": "qwen3.7-plus", "name": "qwen3.7-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.6-plus", "name": "qwen3.6-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3.5-plus", "name": "qwen3.5-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3-max-2026-01-23", "name": "qwen3-max-2026-01-23", "reasoning": false, "input": ["text"], "contextWindow": 262144, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "qwen3-coder-next", "name": "qwen3-coder-next", "reasoning": false, "input": ["text"], "contextWindow": 262144, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "qwen3-coder-plus", "name": "qwen3-coder-plus", "reasoning": false, "input": ["text"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "MiniMax-M2.5", "name": "MiniMax-M2.5", "reasoning": false, "input": ["text"], "contextWindow": 204800, "maxTokens": 131072, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "glm-5", "name": "glm-5", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "glm-4.7", "name": "glm-4.7", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "kimi-k2.5", "name": "kimi-k2.5", "reasoning": false, "input": ["text", "image"], "contextWindow": 262144, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } } ] } } }, "agents": { "defaults": { "model": { "primary": "bailian-coding-plan/qwen3.7-plus" }, "models": { "bailian-coding-plan/qwen3.7-plus": {}, "bailian-coding-plan/qwen3.6-plus": {}, "bailian-coding-plan/qwen3.5-plus": {}, "bailian-coding-plan/qwen3-max-2026-01-23": {}, "bailian-coding-plan/qwen3-coder-next": {}, "bailian-coding-plan/qwen3-coder-plus": {}, "bailian-coding-plan/MiniMax-M2.5": {}, "bailian-coding-plan/glm-5": {}, "bailian-coding-plan/glm-4.7": {}, "bailian-coding-plan/kimi-k2.5": {} } } }, "gateway": { "mode": "local", "auth": { "mode": "none" } } } -
儲存並應用
先單擊 Save 按鈕將配置寫入磁碟,再單擊 Apply 按鈕重啟網關使配置生效。
隨用隨付
將 YOUR_API_KEY 替換為阿里雲百鍊 API Key(格式為 sk-xxxxx)。可用模型請參考模型廣場。
|
API Key |
阿里雲百鍊 API Key,格式為 |
|---|---|
|
Base URL |
請確保 Base URL、API Key 和模型歸屬同一地區:
|
|
可用模型 |
填入模型廣場中支援的模型 |
以下配置以華北2(北京)地區為例,如使用其他地區請替換 baseUrl 為上表中對應地區的 URL。
設定檔位於 ~/.openclaw/openclaw.json,OpenClaw 啟動時會自動讀取。
樣本禁用了網關鑒權(auth.mode: none),僅適合單機本地使用。如需共用或遠端存取,請運行 openclaw doctor --fix 啟用 token 鑒權。
方式一:終端方式
-
開啟設定檔
nano ~/.openclaw/openclaw.json -
寫入配置
首次配置:複製以下內容到設定檔,將
YOUR_API_KEY替換為百鍊 API Key。已有配置:若需保留已有配置,請勿直接全量替換,詳見已有配置如何安全修改。
{ "meta": { "lastTouchedVersion": "2026.2.1", "lastTouchedAt": "2026-02-03T08:20:00.000Z" }, "models": { "mode": "merge", "providers": { "bailian": { "baseUrl": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic", "apiKey": "YOUR_API_KEY", "api": "anthropic-messages", "models": [ { "id": "qwen3.6-plus", "name": "qwen3.6-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "MiniMax-M2.5", "name": "MiniMax-M2.5", "reasoning": false, "input": ["text"], "contextWindow": 204800, "maxTokens": 131072, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "glm-5", "name": "glm-5", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "deepseek-v3.2", "name": "deepseek-v3.2", "reasoning": false, "input": ["text"], "contextWindow": 163840, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } } ] } } }, "agents": { "defaults": { "model": { "primary": "bailian/qwen3.6-plus" }, "models": { "bailian/qwen3.6-plus": {}, "bailian/MiniMax-M2.5": {}, "bailian/glm-5": {}, "bailian/deepseek-v3.2": {} } } }, "gateway": { "mode": "local", "auth": { "mode": "none" } } } -
儲存並退出
按
Ctrl+X,按Y確認儲存,按Enter確認檔案名稱。 -
使配置生效
運行以下命令重啟網關,使配置生效。
openclaw gateway restart
方式二:Web UI 方式
-
啟動 Web UI
在終端運行以下命令啟動 Web UI:
openclaw dashboard在瀏覽器開啟的頁面中,單擊左側菜單 設定,將編輯器模式從 Form 切換為 Raw。
-
寫入配置
首次配置:複製以下內容到設定檔,將
YOUR_API_KEY替換為百鍊 API Key。已有配置:若需保留已有配置,請勿直接全量替換,詳見已有配置如何安全修改。
{ "meta": { "lastTouchedVersion": "2026.2.1", "lastTouchedAt": "2026-02-03T08:20:00.000Z" }, "models": { "mode": "merge", "providers": { "bailian": { "baseUrl": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic", "apiKey": "YOUR_API_KEY", "api": "anthropic-messages", "models": [ { "id": "qwen3.6-plus", "name": "qwen3.6-plus", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 65536, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "MiniMax-M2.5", "name": "MiniMax-M2.5", "reasoning": false, "input": ["text"], "contextWindow": 204800, "maxTokens": 131072, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, { "id": "glm-5", "name": "glm-5", "reasoning": false, "input": ["text"], "contextWindow": 202752, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } }, { "id": "deepseek-v3.2", "name": "deepseek-v3.2", "reasoning": false, "input": ["text"], "contextWindow": 163840, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "compat": { "thinkingFormat": "openai" } } ] } } }, "agents": { "defaults": { "model": { "primary": "bailian/qwen3.6-plus" }, "models": { "bailian/qwen3.6-plus": {}, "bailian/MiniMax-M2.5": {}, "bailian/glm-5": {}, "bailian/deepseek-v3.2": {} } } }, "gateway": { "mode": "local", "auth": { "mode": "none" } } } -
儲存並應用
先單擊 Save 按鈕將配置寫入磁碟,再單擊 Apply 按鈕重啟網關使配置生效。
接入訊息渠道
步驟一:安裝 WhatsApp 外掛程式
WhatsApp 渠道通過外掛程式方式接入,執行以下命令安裝外掛程式:
openclaw plugins install @openclaw/whatsapp
步驟二:配置 WhatsApp 渠道
在 OpenClaw 對話中輸入以下內容,OpenClaw 會詢問手機號碼(需使用 E.164 格式,即 + 號加國家代碼加手機號),然後自動將號碼填入配置並完成設定。
請幫我配置 WhatsApp 渠道。請先詢問My Phone號碼,然後將號碼自動填入以下配置中的 allowFrom 和 groupAllowFrom 欄位,完成配置。
{
"channels": {
"whatsapp": {
"dmPolicy": "pairing",
"allowFrom": ["<phone_number>"],
"groupPolicy": "allowlist",
"groupAllowFrom": ["<phone_number>"]
}
}
}
建議使用單獨的手機號運行 WhatsApp 渠道,避免機器人響應日常聊天中的訊息。如果使用日常聊天的手機號,可在 OpenClaw 對話中輸入開啟 selfChatMode,機器人將僅在給自己發訊息的對話中響應,不影響其他聊天。
步驟三:關聯 WhatsApp
-
執行以下命令啟動 WhatsApp 關聯流程,終端會顯示二維碼。
openclaw channels login --channel whatsapp -
開啟手機 WhatsApp,掃描終端中的二維碼完成關聯。
-
重啟網關。
openclaw gateway restart
步驟四:測試
-
執行以下命令檢查 WhatsApp 渠道狀態。
openclaw status在 Channels 部分,WhatsApp 應顯示為
ON且狀態為OK。 -
在 WhatsApp 中給自己發送一條訊息,驗證機器人是否正常響應。
Telegram
-
通過 BotFather 建立機器人
發送
/newbot命令,按提示輸入機器人名稱和使用者名稱(使用者名稱必須以bot結尾),複製並儲存返回的 Bot Token(格式為:123456789:ABCdefGHIjklMNOpqrsTUVwxyz)。 -
在 OpenClaw 對話中輸入如下內容,並將 xxxx 替換為實際的 Bot Token。OpenClaw 會自動完成配置。
請幫我配置Telegram,配置項如下,我的Bot Token是xxxx。 { "channels": { "telegram": { "enabled": true, "botToken": "xxxx", "dmPolicy": "pairing" } } } -
配置完成後,重啟網關。
openclaw gateway restart -
在 Telegram 中發送訊息給機器人,首次發送訊息會收到配對碼。
-
在終端執行以下命令,將 xxx 替換為實際的配對碼。
openclaw pairing approve telegram xxx
Discord
步驟一:建立 Discord 應用和機器人
-
建立 Discord 應用
進入 Discord Developer Portal,單擊 New Application,輸入應用程式名稱,然後單擊 Create。
-
建立機器人並開啟許可權
-
在左側導覽列單擊 Bot,設定機器人使用者名稱。
-
在 Bot 頁面向下滾動到 Privileged Gateway Intents,開啟以下許可權:
-
Message Content Intent
-
Server Members Intent
-
Presence Intent
完成後單擊 Save Changes。
-
-
-
擷取 Bot Token
在 Bot 頁面頂部,單擊 Reset Token 產生令牌,複製並妥善儲存。此令牌僅顯示一次。
-
添加機器人到伺服器
-
在左側導覽列單擊 OAuth2,向下滾動到 OAuth2 URL Generator。
-
在 Scopes 中勾選
bot和applications.commands。 -
在下方出現的 Bot Permissions 中勾選以下許可權:
-
View Channels
-
Send Messages
-
Read Message History
-
Embed Links
-
Attach Files
-
-
複製頁面底部產生的 URL,在瀏覽器中開啟,選擇目標伺服器並單擊 Continue 完成添加。
-
步驟二:在 OpenClaw 中配置 Discord
-
在運行 OpenClaw 的機器上,設定 Bot Token 環境變數。
export DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN" -
執行以下命令完成 Discord 配置。
openclaw config set channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKEN openclaw config set channels.discord.enabled true --strict-json -
重啟網關使配置生效。
openclaw gateway restart
步驟三:配對與測試
-
在 Discord 中向機器人發送私信,首次發送會收到配對碼(Pairing Code)。
-
在終端執行以下命令完成配對,將 xxx 替換為實際的配對碼。
openclaw pairing approve discord xxx說明配對碼有效期間為 1 小時,到期需重新發送訊息擷取新的配對碼。
-
執行以下命令檢查 Discord 渠道狀態。
openclaw status在 Channels 部分,Discord 應顯示為
ON且狀態為OK。 -
在 Discord 中發送訊息進行測試。
常見命令
|
命令 |
說明 |
樣本 |
|---|---|---|
|
/help |
顯示可用命令的快速摘要。 |
/help |
|
/status |
查看當前模型、會話、網關等狀態資訊。 |
/status |
|
/model <模型名稱> |
切換當前會話使用的模型。 |
/model qwen3.7-max |
|
/new |
開始一個新會話。 |
/new |
|
/compact |
壓縮對話歷史,釋放上下文視窗空間。 |
/compact |
|
/think <層級> |
設定思考(推理)深度層級,可選 off、low、medium、high 等。 |
/think high |
|
/skills |
展示全部可用的 Skill。 |
/skills |
使用案例
案例一:X(Twitter)自動營運
通過 OpenClaw 可自動化營運 X (Twitter) 帳號,支援發帖、回複、搜尋、時間軸瀏覽等操作。
案例二:YouTube 視頻分析與下載
通過OpenClaw 可以搜尋 YouTube 視頻、提取視頻資訊並下載視頻,支援按關鍵詞搜尋、按日期排序、批量擷取視頻中繼資料等操作。
案例三:定時推送 AI 新聞
通過 OpenClaw 的 Cron 定時任務功能,每天自動抓取最新 AI 新聞並推送到 WhatsApp。
案例四:股市監控與分析
讓 OpenClaw 分析股票走勢,並提供技術面分析和投資建議。
AI 產生內容僅供參考,不構成實際的投資建議或決策依據。
瞭解更多
Skill
Skill 是可擴充的能力模組,Agent 會根據請求自動匹配並載入對應的 Skill。OpenClaw 支援查看和啟用內建 Skill,從 ClawHub安裝社區 Skill,或建立自訂 Skill。
查看已有 Skill
-
執行以下命令查看已安裝的 Skill 及其狀態。
# 列出已安裝的 Skill openclaw skills list # 查看 Skill 狀態(已啟用、已禁用、缺少依賴等) openclaw skills check # 查看特定 Skill 的詳細資料 openclaw skills info <skill-name> -
內建 Skill 預設未啟用,需在
~/.openclaw/openclaw.json中通過skills.allowBundled白名單啟用,只有列在其中的內建 Skill 才會被載入。{ "skills": { "allowBundled": [ "github", "weather", "summarize", "coding-agent", "clawhub", "nano-pdf", "google-web-search", "image-lab" ] } }
部分內建 Skill需要配置對應的第三方 API Key 才能使用,請在 ~/.openclaw/openclaw.json 的 skills.entries 中配置,具體請參考 Skills 配置文檔。
尋找更多 Skill
可以通過以下兩種方式尋找並安裝更多 Skill。
-
通過 ClawHub 搜尋安裝
ClawHub 提供 3,000+ 個社區 Skill,可以在網站上瀏覽,也可以通過命令列搜尋。
# 按關鍵詞搜尋 npx clawhub search [關鍵詞] # 瀏覽最新動向的 Skill npx clawhub explore找到合適的 Skill 後,執行以下命令安裝,安裝完成後重啟網關即可使用。
npx clawhub install <skill-name> -
直接在 OpenClaw 中提問
在對話中直接描述需求,例如
幫我找一個可以查天氣的 Skill,OpenClaw 會自動搜尋並安裝。
建立自訂 Skill
-
建立 Skill 目錄。
mkdir -p ~/.openclaw/workspace/skills/my-custom-skill -
在該目錄下建立
SKILL.md檔案。檔案由 YAML 前置中繼資料和 Markdown 指令兩部分組成,其中name和description為必要欄位。Agent 根據description判斷是否載入該 Skill,請確保描述準確。--- name: my-custom-skill description: 簡短描述 --- # My Custom Skill 當使用者請求 XXX 時,執行以下操作: 1. 使用 bash 工具運行 xxx 命令 2. 解析輸出結果 3. 以表格形式返回給使用者 -
重啟網關使 Skill 生效。
# 重啟網關 openclaw gateway restart # 查看 Skill 是否生效 openclaw skills list
更多 Skill 配置說明請參考OpenClaw 官方文檔。