OpenClaw 配置
全部文档OpenClaw
在 OpenClaw 中使用平台的模型。OpenClaw 使用 OpenAI 接口。
准备工作
- API 密钥:在控制台的 API 密钥 页新建,把下文配置里的
sk-...换成你的密钥。 - 接入地址:
https://api.gxcy.com/v1(OpenAI 接口)。 - 模型:可以调用的模型见控制台的 模型 页,下文以
deepseek-flash为例。
安装
OpenClaw 需要 Node.js 24(24.16 或更新)或 26(26.1 或更新),推荐 Node.js 26。安装脚本会在缺少时自动安装。
macOS / Linux:
curl -fsSL https://openclaw.ai/install.sh | bash
Windows(PowerShell):
iwr -useb https://openclaw.ai/install.ps1 | iex
配置
安装完成后会自动进入配置向导,也可以执行 openclaw onboard 重新进入。
- 选择服务商时,在「More…」中选「Custom Provider」。
- 兼容类型选 OpenAI-compatible,依次填写:
- Base URL:
https://api.gxcy.com/v1 - API Key:你的 API 密钥
- 模型:从拉取到的模型列表中选择,或手动输入
deepseek-flash
- Base URL:
- 向导会实际调用一次模型,验证通过后保存,随后启动 Gateway 并在浏览器中打开控制台。
在配置文件中添加模型
要添加更多模型或补充模型的参数,编辑 ~/.openclaw/openclaw.json 中的 models 与 agents 两项:
{
"models": {
"mode": "merge",
"providers": {
"custom": {
"baseUrl": "https://api.gxcy.com/v1",
"apiKey": "sk-...",
"api": "openai-completions",
"models": [
{ "id": "deepseek-flash", "name": "deepseek-flash", "input": ["text"] }
]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "custom/deepseek-flash" }
}
}
}
custom是服务商的名称,可以自取;向导保存的服务商也在providers下,可以直接在其中添加模型。primary是默认使用的模型,写成“服务商名称/模型名称”。models里可以列多个模型。模型支持识图时,把input写成["text", "image"];也可以按模型补充contextWindow(上下文长度)、maxTokens(最大输出)与reasoning(是否为推理模型)。
使用
执行下面的命令,在终端里与机器人对话,能正常回复即配置成功:
openclaw chat
openclaw tui 也可以对话,但需要 Gateway 在运行;Gateway 没有运行时,先执行 openclaw gateway。
也可以执行 openclaw dashboard,在浏览器中打开控制台对话。
接入聊天渠道
OpenClaw 还可以接入飞书、Discord 等聊天渠道,设置方法见 OpenClaw 官方文档 Chat Channels。