OpenClaw 是一个开源的个人 AI 助手平台,支持通过多种消息渠道与 AI 交互。通过配置可接入阿里云百炼平台上的 AI 模型,支持按量付费、Coding Plan、Token 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 个人版
配置项 | 说明 |
|---|---|
API Key | Token Plan 个人版专属 API Key |
Base URL |
|
可用模型 | Token Plan 个人版支持的模型 |
配置文件位于 ~/.openclaw/openclaw.json,OpenClaw 启动时会自动读取。
说明示例禁用了网关鉴权(auth.mode: none),仅适合单机本地使用。如需共享或远程访问,请运行 openclaw doctor --fix 启用 token 鉴权。
首次配置:复制以下内容到配置文件,将 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": "auto",
"name": "auto",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"maxTokens": 393216,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "qwen3.8-max",
"name": "qwen3.8-max",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 983616,
"maxTokens": 131072,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"compat": { "thinkingFormat": "openai" }
},
{
"id": "qwen3.8-flash",
"name": "qwen3.8-flash",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 983616,
"maxTokens": 131072,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"compat": { "thinkingFormat": "openai" }
},
{
"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-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": "glm-5.3",
"name": "glm-5.3",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"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": "deepseek-v4.1-flash",
"name": "deepseek-v4.1-flash",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 393216,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
}, {
"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-pro-0813",
"name": "deepseek-v4-pro-0813",
"reasoning": false,
"input": ["text"],
"contextWindow": 163840,
"maxTokens": 32768,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "deepseek-v4-flash-0731",
"name": "deepseek-v4-flash-0731",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"maxTokens": 393216,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "bailian-token-plan/auto"
},
"models": {
"bailian-token-plan/auto": {},
"bailian-token-plan/qwen3.8-max": {},
"bailian-token-plan/qwen3.8-flash": {},
"bailian-token-plan/qwen3.7-max": {},
"bailian-token-plan/qwen3.7-plus": {},
"bailian-token-plan/qwen3.6-flash": {},
"bailian-token-plan/glm-5.3": {},
"bailian-token-plan/glm-5.2": {},
"bailian-token-plan/deepseek-v4.1-flash": {},
"bailian-token-plan/deepseek-v4-pro": {},
"bailian-token-plan/deepseek-v4-pro-0813": {},
"bailian-token-plan/deepseek-v4-flash-0731": {},
}
}
},
"gateway": {
"mode": "local",
"auth": { "mode": "none" }
}
}
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": "auto",
"name": "auto",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"maxTokens": 393216,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "qwen3.8-max",
"name": "qwen3.8-max",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 983616,
"maxTokens": 131072,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"compat": { "thinkingFormat": "openai" }
},
{
"id": "qwen3.8-flash",
"name": "qwen3.8-flash",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 983616,
"maxTokens": 131072,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"compat": { "thinkingFormat": "openai" }
},
{
"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.1-flash",
"name": "deepseek-v4.1-flash",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 393216,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"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-pro-0813",
"name": "deepseek-v4-pro-0813",
"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-v4-flash-0731",
"name": "deepseek-v4-flash-0731",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"maxTokens": 393216,
"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.3",
"name": "glm-5.3",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"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/auto"
},
"models": {
"bailian-token-plan/auto": {},
"bailian-token-plan/qwen3.8-max": {},
"bailian-token-plan/qwen3.8-flash": {},
"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.1-flash": {},
"bailian-token-plan/deepseek-v4-pro": {},
"bailian-token-plan/deepseek-v4-pro-0813": {},
"bailian-token-plan/deepseek-v4-flash": {},
"bailian-token-plan/deepseek-v4-flash-0731": {},
"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.3": {},
"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。 2. 写入配置
首次配置:复制以下内容到配置文件,将 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": "auto",
"name": "auto",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"maxTokens": 393216,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"id": "qwen3.8-max",
"name": "qwen3.8-max",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 983616,
"maxTokens": 131072,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"compat": { "thinkingFormat": "openai" }
},
{
"id": "qwen3.8-flash",
"name": "qwen3.8-flash",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 983616,
"maxTokens": 131072,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"compat": { "thinkingFormat": "openai" }
},
{
"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.1-flash",
"name": "deepseek-v4.1-flash",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 393216,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
},
{
"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-pro-0813",
"name": "deepseek-v4-pro-0813",
"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-v4-flash-0731",
"name": "deepseek-v4-flash-0731",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"maxTokens": 393216,
"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.3",
"name": "glm-5.3",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"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/auto"
},
"models": {
"bailian-token-plan/auto": {},
"bailian-token-plan/qwen3.8-max": {},
"bailian-token-plan/qwen3.8-flash": {},
"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.1-flash": {},
"bailian-token-plan/deepseek-v4-pro": {},
"bailian-token-plan/deepseek-v4-pro-0813": {},
"bailian-token-plan/deepseek-v4-flash": {},
"bailian-token-plan/deepseek-v4-flash-0731": {},
"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.3": {},
"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
配置项 | 说明 |
|---|---|
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。 2. 写入配置
首次配置:复制以下内容到配置文件,将 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 按钮重启网关使配置生效。
按量付费
配置项 | 说明 |
|---|---|
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。 2. 写入配置
首次配置:复制以下内容到配置文件,将 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。
2. 在 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。
4. 在 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) 账号,支持发帖、回复、搜索、时间线浏览等操作。
配置步骤
- 在终端执行以下命令安装 twitter-cli。
uv tool install twitter-cli
- 在 OpenClaw 对话中输入以下指令,自动完成 Skill 安装。
Install this skill: https://github.com/public-clis/twitter-cli
- 安装完成后,返回终端并重启网关使 Skill 生效。
openclaw gateway restart
- 验证 Skill 是否安装成功。
openclaw skills list
-
twitter-cli 使用浏览器 Cookie 进行认证。请确保已在支持的浏览器(Chrome、Edge、Firefox、Arc 或 Brave)中登录 x.com,twitter-cli 会自动提取 Cookie。
也可以通过环境变量手动设置认证信息:
export TWITTER_AUTH_TOKEN="your_auth_token"
export TWITTER_CT0="your_ct0_token"
说明Cookie 获取方式:在浏览器中打开 x.com,打开开发者工具,切换到 Application 面板,在 Cookies 中找到 auth_token 和 ct0 的值。
示例一:自动发布帖子
在 OpenClaw 对话中输入查看 Sam Altman 最近的推文,总结要点后帮我发一条推文谈谈我的看法,OpenClaw 会自动获取动态、分析内容并发布。
示例二:搜索热门话题
输入帮我搜索昨天关于 harness engineering 的推文,OpenClaw 会搜索相关推文并总结要点。
案例二:YouTube 视频分析与下载
通过OpenClaw 可以搜索 YouTube 视频、提取视频信息并下载视频,支持按关键词搜索、按日期排序、批量获取视频元数据等操作。
配置步骤
- 在终端执行以下命令安装 yt-dlp。
pip install yt-dlp
- 验证安装。
yt-dlp --version
- (可选)配置 Cookie 认证。如果需要访问年龄限制、会员专属或私有视频,需要配置 YouTube Cookie。确保已在浏览器中登录 youtube.com,然后在 OpenClaw 对话中输入:
我需要配置 YouTube 的 Cookie 认证,请使用 yt-dlp 从我的浏览器中提取 YouTube 的 Cookie
安装完成后,即可在 OpenClaw 对话中直接使用,OpenClaw 会自动调用 yt-dlp 命令执行视频相关操作。
示例一:视频内容总结
在 OpenClaw 对话中输入帮我总结这个视频的主要内容:https://www.youtube.com/watch?v=XRgGFQ0EgM0,OpenClaw 会提取视频信息并生成内容摘要。
示例二:视频下载
在 OpenClaw 对话中输入帮我下载这个视频:https://www.youtube.com/watch?v=XRgGFQ0EgM0,OpenClaw 会调用 yt-dlp 将视频下载到本地。
案例三:定时推送 AI 新闻
通过 OpenClaw 的 Cron 定时任务功能,每天自动抓取最新 AI 新闻并推送到 Discord(Cron 定时任务支持 discord 和 telegram 渠道)。
配置步骤
- 在终端执行以下命令:
openclaw cron add \
--name "ai-daily-news" \
--cron "0 9 * * *" \
--tz "UTC" \
--message "Please visit https://techcrunch.com/category/artificial-intelligence/ to get today's AI news. Summarize the top 10 most important AI stories in a concise list format, each with a title and a one-sentence summary in English." \
--channel discord \
--announce
参数说明如下:
| 参数 | 说明 | | --- | --- | | --name | 任务名称 | | --cron | Cron 表达式,"0 9 * * *" 表示每天 9:00 执行 | | --tz | 时区,设为 "UTC" 即协调世界时,可按需替换为您所在时区(如 "America/New_York"、"Europe/London") | | --message | 发送给 Agent 的提示词,告诉 AI 要抓取什么内容、如何总结 | | --channel | 推送渠道。Cron 定时任务支持 discord 和 telegram,此处设为 discord。 | | --announce | 将结果推送到已配置的 Discord 频道中。 |
创建成功后将返回 JSON 格式的任务信息,包含任务 ID 和下次执行时间。 2. 创建任务后,可以立即手动触发一次以验证效果。
- 查看任务列表,获取任务 ID。
openclaw cron list
- 手动触发执行。
openclaw cron run <task_ID> --timeout 120000
- 查看执行结果。
openclaw cron runs --id <task_ID>
当输出中 "status": "ok" 且 "delivered": true 时,表示新闻已成功推送到 Discord。
案例四:股市监控与分析
让 OpenClaw 分析股票走势,并提供技术面分析和投资建议。
说明
AI 生成内容仅供参考,不构成实际的投资建议或决策依据。配置步骤
-
安装 Skill
在 OpenClaw 对话中输入以下指令,OpenClaw 会自动完成安装:
Install the manus-stock-analysis skill
- 安装完成后,返回终端并重启网关使 Skill 生效。
openclaw gateway restart
验证 Skill 是否安装成功。
openclaw skills list
- 在 OpenClaw 对话中输入股市相关问题,例如
Analyze NVDA stock。
了解更多
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 官方文档。
常见问题
如何查看已配置的模型?
在终端输入openclaw tui,进入 OpenClaw 终端命令行,接着输入/model查看模型列表。按回车键选中模型,按Esc键退出模型列表。
为什么报错"HTTP 401: Incorrect API key provided."、"No API key found for provider xxx"或"HTTP 401: invalid_iam_token"?
可能原因:
- API Key 无效、过期、为空、格式错误,或与端点环境不匹配。请检查 API Key 是否与所使用的付费方式匹配,并确保复制完整且无空格;确认订阅状态有效。
- OpenClaw 的历史配置缓存导致配置错误,请删除
~/.openclaw/agents/main/agent/models.json文件中的providers配置项,并重启 OpenClaw。 invalid_iam_token表示 API Key 经 IAM 鉴权校验失败。常见场景:API Key 已被吊销或禁用、API Key 归属的地域与 Base URL 所指地域不一致(例如 API Key 在华北2(北京),但 Base URL 指向新加坡)、使用 STS 临时凭证且已过期。请核对 API Key 与 Base URL 归属同一地域,并确认 API Key 状态正常。
我已经配置过钉钉等其他渠道,如何安全地添加新套餐模型(防止原有配置丢失)?
-
请勿直接全量覆盖。直接"全部替换"会覆盖掉自定义配置,请进行局部修改。
-
可以选择以下方式完成配置:
- 若 OpenClaw 可正常对话:直接在 OpenClaw 对话中输入指令完成配置合并。
- 若 OpenClaw 未配置模型或无法对话:请手动编辑
~/.openclaw/openclaw.json,只修改需要变更的字段,保留原有配置不变。
重启网关后,已有会话可能无法正常对话,请重启会话。
报错 device identity required 怎么办?
详细报错信息:
http://127.0.0.1:18791/15:05:56 [ws] closed before connect conn=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1008 reason=device identity required
原因:客户端连接网关时未提供设备身份信息,通常由以下原因导致:
- 首次打开浏览器访问地址,尚未完成设备配对。
- 浏览器缓存被清除,设备密钥丢失。
- 重装或升级 OpenClaw 后,
~/.openclaw/identity/目录下的密钥文件缺失。
在终端执行以下命令,允许当前设备连接并重新生成浏览器访问地址:
openclaw devices approve --latest
openclaw dashboard --no-open
如果仍未解决,先清除异常的设备记录再重试:
openclaw devices clear --pending --yes
openclaw dashboard --no-open
执行 openclaw devices list,确认设备显示在 Paired 列表中即为正常。
没有主动使用 OpenClaw,但仍产生了 Token 消耗
原因:OpenClaw 内置心跳机制(Heartbeat),网关运行期间会按固定间隔(默认 30 分钟)自动调用已配置的模型,检查是否有待处理任务。每次心跳都会消耗少量 Token。
如何确认:查看 ~/.openclaw/agents/main/sessions/ 目录下的会话记录文件(.jsonl),其中包含 [OpenClaw heartbeat poll] 标记的心跳调用记录。
- 停止网关:不使用时执行
openclaw gateway stop,心跳随即停止。 - 增大心跳间隔:在
~/.openclaw/openclaw.json中设置agents.defaults.heartbeat.every,例如"2h"表示每 2 小时一次。