OpenClaw 使用指南
OpenClaw 是一个开源的个人 AI 助手平台,支持通过命令行、Web 界面以及钉钉等多种消息渠道进行交互。本指南介绍如何将 OpenClaw 接入 OPEAI Platform,使用 Claude 系列模型进行对话。
模型支持与选型
通过 OPEAI Platform 接入时,推荐使用以下模型:
| 模型 | 说明 |
|---|---|
claude-sonnet-4.6 | 推荐,综合能力强,响应速度快 |
完整的可用模型列表请登录 OPEAI Platform 控制台 查看。
安装 OpenClaw
环境要求
- Node.js 22 或更高版本
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 --version
如果正确输出版本号,说明安装成功。
完成初始配置向导
首次安装后,OpenClaw 会自动启动配置向导,帮助您快速完成初始设置。您也可以手动执行 openclaw onboard 命令进行配置。
| 配置项 | 建议配置 |
|---|---|
| I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue? | 选择 Yes |
| Onboarding mode | 选择 QuickStart |
| Model/auth provider | 选择 Skip for now(稍后配置 OPEAI Platform 模型) |
| 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 |
配置 OpenClaw(指向 OPEAI Platform)
接入 OPEAI Platform 需要配置以下关键参数:
| 参数 | 值 |
|---|---|
| baseUrl | https://api-platform.ope.ai/v1 |
| apiKey | 从 OPEAI Platform 控制台 获取 |
| api | openai-completions |
| models | 配置模型列表,如 claude-sonnet-4.6 |
重要:请确保在模型配置中将
reasoning参数设为false,否则可能导致回复内容为空。
用文本编辑器打开 ~/.openclaw/openclaw.json,在配置文件中添加以下内容:
{
"models": {
"providers": {
"platform": {
"baseUrl": "https://api-platform.ope.ai/v1",
"apiKey": "sk-xxxx",
"api": "openai-completions",
"models": [
{
"id": "claude-sonnet-4.6",
"name": "Claude Sonnet 4.6",
"reasoning": false
}
]
}
}
}
}
注意:请使用你自己的 Platform API Key,并避免在截图、终端历史或日志中泄露真实密钥。
使用 OpenClaw
命令行模式
openclaw tui
启动交互式命令行界面,直接在终端中与 AI 对话。
Web 界面
openclaw dashboard
访问 http://127.0.0.1:18789,通过浏览器进行对话。
集成聊天工具
OpenClaw 还支持接入钉钉等聊天工具,具体配置请参考 OpenClaw 官方文档。
常见问题排查
回复内容为空
- 检查
reasoning参数是否设为false - 确认 Model ID 拼写正确(如
claude-sonnet-4.6) - 确认
provider名称与配置一致
提示模型不存在
- 确认模型名称拼写无误
- 登录 OPEAI Platform 控制台 确认该模型可用
command not found
- OpenClaw 安装没有成功。请在云服务器或本地终端执行
openclaw --version,若输出版本号证明安装成功 - 确认 Node.js 版本 ≥ 22
- 尝试重新安装:
npm install -g openclaw@latest