~/.openclaw/openclaw.json):⚠️ 提示: 如果您之前已经配置过其他大模型(如小龙虾),您可以直接跳到下方的**“方案 B:只添加模型”**部分,或使用命令行让工具自动添加模型。
openclaw.json 文件。您可以按需替换 API 地址、API Key 和访问 Token。后续也可以通过运行 openclaw config 命令或直接修改该文件来持续调整配置。openclaw.json 参考模板{
"gateway": {
"port": 18789,
"mode": "local",
"auth": {
"token": "你的访问令牌" // 访问 Dashboard 登录需要用到
},
"trustedProxies": ["127.0.0.1"],
"controlUi": {
"allowedOrigins": ["*"],
"allowInsecureAuth": true
}
},
"browser": {
"enabled": true,
"executablePath": "/usr/bin/chromium-browser", // 需要先在服务器安装 Chromium
"headless": true,
"noSandbox": true
},
"agents": {
"defaults": {
"model": {
"primary": "claude/claude-opus-4-6-thinking", // 主模型
"fallbacks": [ // 备用模型
"claude/claude-sonnet-4-6-thinking",
"claude/claude-sonnet-4-6",
"gpt/gpt-5.4",
"gemini/gemini-3.1-pro-preview"
]
},
"models": {
"gemini/gemini-3.1-pro-preview": {
"alias": "gemini 3 pro"
}
},
"imageModel": {
"primary": "gemini/gemini-3.1-pro-preview"
},
"compaction": {
"mode": "default"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
"models": {
"mode": "merge",
"providers": {
"claude": {
"baseUrl": "https://api.omove.ai/v1",
"apiKey": "sk-你的Claude令牌",
"api": "anthropic-messages",
"models": [
{
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 16384
},
{
"id": "claude-sonnet-4-6-thinking",
"name": "Claude Sonnet 4.6 思考版",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 8192
}
]
},
"gpt": {
"baseUrl": "https://api.omove.ai/v1",
"apiKey": "sk-你的GPT令牌",
"api": "openai-completions",
"models": [
{
"id": "gpt-5.4",
"name": "GPT-5.4",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 16384
}
]
},
"gemini": {
"baseUrl": "https://api.omove.ai/v1",
"apiKey": "sk-你的Gemini令牌",
"api": "openai-completions",
"models": [
{
"id": "gemini-3.1-pro-preview",
"name": "Gemini 3.1 Pro",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1048576,
"maxTokens": 65536
}
]
}
}
},
"channels": {
"telegram": {
"enabled": true,
"botToken": "你的TelegramBotToken",
"dmPolicy": "allowlist",
"allowFrom": ["*"],
"groupPolicy": "allowlist",
"streaming": "partial"
},
"feishu": {
"enabled": true,
"dmPolicy": "open",
"allowFrom": ["*"],
"appId": "你的appid",
"appSecret": "你的appSecret",
"connectionMode": "websocket",
"domain": "feishu",
"groupPolicy": "open",
"streaming": true,
"footer": {
"elapsed": true,
"status": true
}
}
},
"plugins": {
"slots": {
"memory": "memory-lancedb"
},
"entries": {
"memory-lancedb": {
"enabled": true,
"config": {
"embedding": {
"apiKey": "sk-用于embedding的令牌" // 永久记忆
}
}
}
}
},
"messages": {
"ackReactionScope": "group-mentions"
},
"commands": {
"native": "auto",
"nativeSkills": "auto",
"restart": true
}
}openclaw.json,在 models.providers 节点里添加下方代码(添加不同厂商模型时请用逗号隔开):"claude": {
"baseUrl": "https://api.omove.ai/v1",
"apiKey": "sk-", // 替换自己的 api key
"api": "anthropic-messages",
"models": [
{
"id": "claude-opus-4-6-thinking",
"name": "Claude Opus 4.6 思考版",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 16384
}
]
}"gpt": {
"baseUrl": "https://api.omove.ai/v1",
"apiKey": "sk-", // 替换自己的 api key
"api": "openai-completions",
"models": [
{
"id": "gpt-5.4",
"name": "GPT-5.4",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 16384
}
]
}"gemini": {
"baseUrl": "https://api.omove.ai/v1",
"apiKey": "sk-", // 替换自己的 api key
"api": "openai-completions",
"models": [
{
"id": "gemini-3.1-pro-preview",
"name": "Gemini 3.1 Pro",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1048576,
"maxTokens": 65536
}
]
}openclaw.json 文件的 agents.defaults.model.primary 中,添加上述模型为您期望的主模型,fallbacks 为备用模型,imageModel 为视觉模型。nohup 命令在后台启动网关服务(注意:启动过程可能会有几十秒的延迟加载时间):http://你的服务器IP:18789/#token=你设置的token令牌值pairing 字样,则说明需要进行设备验证。im:,开通所有消息相关权限(可自选),并确认开通。Local -> Channels -> Configure/link -> feishu(飞书) -> Download from npm(安装飞书插件)App Secret 和 App ID,分别粘贴到终端中并回车。WebSocket -> Feishu.cn China -> Open re... -> Finished -> yes -> pairing -> Continue。