OpenClaw 是一个开源的个人 AI 助手平台,支持通过多种消息渠道与 AI 交互。通过配置可接入阿里云百炼平台上的 AI 模型,支持按量付费、Coding Plan、Token Plan 团队版三种接入方式。
安装 OpenClaw
OpenClaw 需要 Node.js 22 或更高版本。可通过以下命令检查 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 方式仅在 OpenClaw ≤ 2026.3.28 可用,更高版本请使用方式一:终端方式。
-
启动 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 方式仅在 OpenClaw ≤ 2026.3.28 可用,更高版本请使用方式一:终端方式。
-
启动 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 方式仅在 OpenClaw ≤ 2026.3.28 可用,更高版本请使用方式一:终端方式。
-
启动 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 渠道。请先询问我的手机号码,然后将号码自动填入以下配置中的 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 官方文档。