提示:不带子命令的
openclaw config会打开向导。

安装时选择 Skip for now
使用 openclaw configure --section models 命令进入交互配置CLI,配置完成后运行 openclaw gateway restart 重启生效。
修改默认模型
- 运行
openclaw dashboard会自动打开 OpenClaw 的控制台页面(通常是 http://127.0.0.1:18789 )。 - 配置 > RAW(或Config > RAW)。
- 修改
agents.defaults.model.primary字段为目标模型。- 或者直接在
~/.openclaw/openclaw.json中修改,但需要重启。
- 或者直接在
- 配置完成后,单击右上角 Save 保存配置,单击 Update。
[不推荐]手工修改~/.openclaw/openclaw.json的models与agents节点
不推荐原因是未来json格式变化就不适用了,下面以兼容OpenAPI为示例。
- 注意:使用上面两个方法,会自动生成,但手工修改配置文件,需要重启网关才生效。
- 修改有备注的行,其他行直接复制使用。
"models": {
"mode": "merge",
"providers": {
"custom-ark-cn-beijing-volces-com": {
// 第一个
},
"custom-qwen3-5-plus-aliyuncs-com": { // 为 兼容OpenAPI 的 Endpoint ID
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", // baseUrl
"apiKey": "sk-xxx", // apiKey
"api": "openai-completions",
"models": [
{
"id": "qwen3.5-plus", // 为 Model ID
"name": "qwen3.5-plus (Custom Provider)",
"reasoning": false,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 16000,
"maxTokens": 4096
}
]
} // 还有第三个的话,继续。
}
},
"agents": {
"defaults": {
"model": {
"primary": "custom-qwen3-5-plus-aliyuncs-com/qwen3.5-plus"
},
"models": {
"custom-ark-cn-beijing-volces-com/glm-4-7-251222": { // 第一个
"alias": "volcengine_glm47"
},
"custom-qwen3-5-plus-aliyuncs-com/qwen3.5-plus": { // 本次新增
"alias": "aliyuncs_qwen3-5-plus" // 为 Model alias (optional)
} // 还有第三个的话,继续。
},
"workspace": "C:\\Users\\xxx\\.openclaw\\workspace"
}
},
发表回复