OpenClaw
更新时间 2026-04-27 16:45:11
最近更新时间: 2026-04-27 16:45:11
OpenClaw 添加模型配置
方式一:通过Web UI修改配置文件(适用于Windows或者Mac系统)
在终端执行以下命令打开 Web UI。
openclaw dashboard在Web UI的左侧菜单栏中选择 “配置”-> “All Settings” -> “RAW”。
复制以下内容(以GLM-5-Pro为例)到Raw JSONS输入框,替换已有内容,并将YOUR_API_KEY替换为为你的API Key。
注意
配置models下的id 和 model_name 来源于您当前购买实际的可用模型,以下示例配置以GLM-5-Pro为例
{
"models": {
"mode": "merge",
"providers": {
"xirang": {
"baseUrl": "https://wishub-x6.ctyun.cn/v1",
"apiKey": "YOUR_API_KEY",
"api": "openai-completions",
"models": [
{
"id": "GLM-5-Pro",
"name": "GLM-5-Pro",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 204800,
"maxTokens": 131072
},
{
"id": "DeepSeek‑V3.2‑Pro",
"name": "DeepSeek‑V3.2‑Pro",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 131072,
"maxTokens": 16384
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "xirang/GLM-5-Pro"
},
"models": {
"xirang/DeepSeek-V3.2-Pro": {},
"xirang/GLM-5-Pro": {}
}
}
},
"gateway": {
"mode": "local"
}
}点击右上角 Save 保存,再点击 Update 使配置生效,保存成功后,apiKey将显示为“__OPENCLAW_REDACTED__”。由于脱敏保护,仅在前端界面隐藏,不影响实际调用。
方式二:通过终端修改配置文件(适用于Windows 、mac 系统、Linux系统)
在终端执行以下命令打开配置文件
Mac系统和Linux系统执行以下命令:
nano ~/.openclaw/openclaw.jsonWindows系统执行以下命令(Windows系统推荐优先使用方式一):
notepad %USERPROFILE%\.openclaw\openclaw.json复制以下内容(以GLM-5-Pro为例)到配置文件。将YOUR_API_KEY替换为服务组的API Key。
{
"models": {
"mode": "merge",
"providers": {
"xirang": {
"baseUrl": "https://wishub-x6.ctyun.cn/v1",
"apiKey": "YOUR_API_KEY",
"api": "openai-completions",
"models": [
{
"id": "GLM-5-Pro",
"name": "GLM-5-Pro",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 204800,
"maxTokens": 131072
},
{
"id": "DeepSeek‑V3.2‑Pro",
"name": "DeepSeek‑V3.2‑Pro",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 131072,
"maxTokens": 16384
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "xirang/GLM-5-Pro"
},
"models": {
"xirang/DeepSeek-V3.2-Pro": {},
"xirang/GLM-5-Pro": {}
}
}
},
"gateway": {
"mode": "local"
}
}openClaw 使用
方式一:Windows或者Mac环境
新开一个终端,运行以下命令。
openclaw dashboard在Web UI点击左侧顶部“聊天”进入聊天窗口后,输入Message进行对话。
方式二:Linux环境
新开一个终端,运行以下命令,进入TUI界面。
openclaw tui在TUI界面进行对话。