位置:首页 > 新手教程 > OpenClaw接入国内五大主流大模型配置指南

OpenClaw接入国内五大主流大模型配置指南

时间:2026-08-21  |  作者:星际追番人  |  阅读:0

前言

OpenClaw(曾用名Moltbot、Clawdbot)是2026年初爆火的开源个人AI助手项目,支持本地部署,还能无缝对接微信、钉钉、飞书等主流消息平台。国内开发者在配置时,常常卡在两个核心环节上:一是命令行配置与URL修正,二是国内外版本的区分问题。这篇指南基于最新的官方文档,直接给出五个主流国产大模型的完整配置方法,拿来就能用。

最后更新于2026-02-27,本次新增了MiniMax-M2.5、GLM-5、Doubao(豆包)模型的配置命令,同时优化了文档结构和操作步骤的描述。

一、MiniMax配置详解

1.1 API密钥获取

先去MiniMax开放平台注册账号,创建API Key。

1.2 配置命令

# 配置MiniMax国内版
openclaw config set 'models.providers.minimax' --json '{
    "baseUrl": "https://api.minimaxi.com/v1",
    "apiKey": "你的MiniMax_API_Key",
    "api": "openai-completions",
    "models": [
        {
            "id": "MiniMax-M2.5",
            "name": "MiniMax M2.5"
        },
        {
            "id": "MiniMax-M2.5-highspeed",
            "name": "MiniMax M2.5 Highspeed"
        },
        {
            "id": "MiniMax-M2.1",
            "name": "MiniMax M2.1"
        },
        {
            "id": "MiniMax-M2.1-highspeed",
            "name": "MiniMax M2.1 Highspeed"
        },
        {
            "id": "MiniMax-M2",
            "name": "MiniMax M2"
        }
    ]
}'
# 设置默认模型
openclaw models set minimax/MiniMax-M2.5

1.3 模型选择

  • MiniMax-M2.5:目前最新模型,性能顶尖,性价比极高,推荐优先使用。
  • MiniMax-M2.5-highspeed:效果和M2.5一样,但速度提升明显,价格自然也更贵。
  • MiniMax-M2.1:多语言编程能力很强,尤其适合代码工程场景。
  • MiniMax-M2.1-highspeed:M2.1的高速版,效果相同,价格更高。
  • MiniMax-M2:专为高效编码和Agent工作流设计。

二、GLM(智谱)配置详解

2.1 API密钥获取

到智谱AI开放平台完成注册,获取API Key。

2.2 配置命令

# 配置GLM国内版
openclaw config set 'models.providers.glm' --json '{
  "baseUrl": "https://open.bigmodel.cn/api/paas/v4",
  "apiKey": "你的GLM_API_Key",
  "api": "openai-completions",
  "models": [
    {
      "id": "GLM-5",
      "name": "GLM 5"
    },
    {
      "id": "GLM-4.7",
      "name": "GLM 4.7"
    },
    {
      "id": "GLM-4.7-FlashX",
      "name": "GLM 4.7 FlashX"
    },
    {
      "id": "GLM-4.6",
      "name": "GLM 4.6"
    },
    {
      "id": "GLM-4.5-air",
      "name": "GLM 4.5 air"
    }
  ]
}'
# 设置默认模型
openclaw models set glm/GLM-5

2.3 模型选择

  • GLM-5:目前最新模型,在复杂系统工程和长程Agent任务上表现突出。
  • GLM-4.7:强化了编码能力、长程任务规划和工具协同,通用能力全面提升,回复更简洁自然,写作也更有沉浸感。
  • GLM-4.7-FlashX:GLM-4.7的轻量高速版本。
  • GLM-4.6:性能出色,高级编码、推理和工具调用能力都很强。
  • GLM-4.5-Air:高性价比之选,在推理、编码和智能体任务上同样表现不俗。

三、Kimi(月之暗面)配置详解

3.1 API密钥获取

在月之暗面开放平台完成注册,申请API访问权限。

3.2 配置命令

# 配置Kimi国内版
openclaw config set 'models.providers.moonshot' --json '{
  "baseUrl": "https://api.moonshot.cn/v1",
  "apiKey": "你的Kimi_API_Key",
  "api": "openai-completions",
  "models": [
    {
      "id": "kimi-k2.5",
      "name": "Kimi k2.5"
    },
    {
      "id": "kimi-k2-0905-preview",
      "name": "Kimi K2"
    }
  ]
}'

# 设置默认模型
openclaw models set moonshot/kimi-k2.5

3.3 模型选择

  • kimi-k2.5:目前最新模型,在Agent、代码、视觉理解以及一系列通用智能任务上取得了开源SoTA表现。
  • kimi-k2-0905-preview:增强了Agentic Coding能力、前端代码的美观度和实用性,上下文理解能力也有提升。

四、Doubao(豆包)配置详解

4.1 API密钥获取

前往火山引擎平台注册,申请API访问权限。

4.2 配置命令

# 配置Doubao国内版
openclaw config set 'models.providers.volcengine' --json '{
  "baseUrl": "https://ark.cn-beijing.volces.com/api/coding/v3",
  "apiKey": "你的方舟API_Key",
  "api": "openai-completions",
  "models": [
    {
      "id": "doubao-seed-2-0-code-preview-260215",
      "name": "DoubaoSeed 2.0 Code"
    },
    {
      "id": "doubao-seed-2-0-pro-260215",
      "name": "DoubaoSeed 2.0 Pro"
    },
    {
      "id": "doubao-seed-2-0-lite-260215",
      "name": "DoubaoSeed 2.0 Lite"
    },
    {
      "id": "doubao-seed-2-0-mini-260215",
      "name": "DoubaoSeed 2.0 Mini"
    },
    {
      "id": "doubao-seed-1-8-251228",
      "name": "DoubaoSeed 1.8"
    },
    {
      "id": "doubao-seed-code-preview-251028",
      "name": "DoubaoSeed Code"
    }
  ]
}'
# 设置默认模型
openclaw models set volcengine/doubao-seed-2-0-code-preview-260215

4.3 模型选择

  • doubao-seed-2-0-code-preview-260215:最新Code版,在Seed 2.0优秀的Agent和VLM能力基础上,专门增强了代码能力,很适合接入各种AI编程工具。
  • doubao-seed-2-0-pro-260215:最新Pro版,旗舰级全能通用模型,面向Agent时代的复杂推理与长链路任务执行,强调多模态理解、长上下文推理、结构化生成与工具增强执行。
  • doubao-seed-2-0-lite-260215:最新Lite版,面向高频企业场景,兼顾性能与成本的均衡型模型。
  • doubao-seed-2-0-mini-260215:最新Mini版,面向低时延、高并发与成本敏感场景。
  • doubao-seed-code-preview-251028:针对Agentic编程任务做了深度优化。
  • doubao-seed-1-8-251228:面向多模态Agent场景定向优化。

五、Qwen(通义千问)配置详解

5.1 API密钥获取

在阿里云通义千问开通服务,获取API Key。

5.2 配置命令

# 配置Qwen国内版
openclaw config set 'models.providers.qwen' --json '{
  "baseUrl": "https://dashscope.aliyun.com/compatible-mode/v1",
  "apiKey": "你的Qwen_API_Key",
  "api": "openai-completions",
  "models": [
    {
      "id": "qwen3-max",
      "name": "Qwen3 Max"
    },
    {
      "id": "qwen3.5-plus",
      "name": "Qwen3.5 Plus"
    },
    {
      "id": "qwen3.5-flash",
      "name": "Qwen3.5 Flash"
    },
    {
      "id": "qwen3-coder-plus",
      "name": "Qwen3 Coder Plus"
    }
  ]
}'

# 设置默认模型
openclaw models set qwen/qwen3-max

5.3 模型选择

  • qwen3-max:千问系列效果最好的模型,适合复杂、多步骤的任务。
  • qwen-plus:能力均衡,推理效果、成本和速度介于Max和Flash之间,中等复杂任务选它没问题。
  • qwen-flash:速度最快、成本最低,简单任务的最佳选择。
  • qwen3-coder-plus:Coding Agent能力强大,擅长工具调用和环境交互。

六、通用配置脚本

如果你用的是其他模型,或者订阅了类似GLM Coding、Minimax Coding Plan、方舟Coding Plan这类编程计划,通用配置脚本可以帮上大忙。

6.1 配置指令

# 通用配置脚本
openclaw config set 'models.providers.自定义名称' --json '{
  "baseUrl": "根据对应官网说明填写调用地址",
  "apiKey": "调用模型API_KEY",
  "api": "openai-completions",
  "models": [
    {
      "id": "模型ID(大小写也要准确)",
      "name": "自定义模型名称"
    }
    ......
  ]
}'
# 设置默认模型
openclaw models set 自定义名称/模型ID

6.2 方舟CodingPlan举例

# 通用配置脚本
openclaw config set 'models.providers.volcenginePlan' --json '{
  "baseUrl": "https://ark.cn-beijing.volces.com/api/coding/v3",
  "apiKey": "你的方舟API_Key",
  "api": "openai-completions",
  "models": [
    { "id": "doubao-seed-code",     "name": "DouBao Seed Code" },
    { "id": "glm-4.7", "name": "GLM 4.7" },
    { "id": "deepseek-v3.2", "name": "DeepSeek V3.2" },
    { "id": "kimi-k2-thinking", "name": "Kimi K2 Thinking" },
    { "id": "kimi-k2.5", "name": "Kimi K2.5" }
  ]
}'

# 设置默认模型
openclaw models set volcenginePlan/doubao-seed-code

七、配置文件修改演示

7.1 配置文件修改方法

# 查看当前配置文件
cat ~/.openclaw/openclaw.json

在打开的配置文件中找到models/providers/位置,就能进行参数调整了。

7.2 配置要点

  • 专用BaseUrl:配置各模型厂家提供的调用地址。
  • 模型名称:支持特定的Model Name,如文档所列,不支持"Auto"。
  • 服务重启:修改配置文件后,必须重启gateway服务才能生效。

八、多模型切换与管理

8.1 查看可用模型

# 列出所有已配置模型
openclaw models list

# 查看模型详细信息
openclaw models status

8.2 快速切换模型

# 在TUI界面中切换
openclaw tui
# 然后输入: /model minimax/MiniMax-M2.1

# 通过命令行切换
openclaw models set glm/GLM-4.7

九、配置验证与常见问题

9.1 配置验证方法

配置完成后,建议用以下命令做个快速检查:

# 检查所有模型状态
openclaw models status

# 进行连通性测试
openclaw models status --probe

# 查看网关运行状态
openclaw gateway status

9.2 常见问题排查

问题1:命令找不到openclaw

解决方案:

# 检查Node.js版本
node --version  # 需要>=22

# 重新安装
npm install -g openclaw@latest

问题2:配置完成后出现no output

原因:输出可能在其他已配置的环境中,比如Web界面、Telegram Bot等。

解决方案:检查其他已配置的频道输出位置。

问题3:国内API连接失败

解决方案:

  • 确认baseUrl使用的是国内版地址
  • 检查API Key是否具有相应权限
  • 验证网络连接是否正常

问题4:模型切换不生效

解决方案:

# 重新加载配置
openclaw config reload

# 重启网关服务
openclaw gateway restart

9.3 最佳实践建议

  • 环境隔离:开发、测试、生产环境使用不同的API Key。
  • 监控配置:定期检查模型使用情况和费用消耗。
  • 备份配置:重要配置修改前,记得备份~/.openclaw/openclaw.json。
  • 版本管理:关注OpenClaw和模型API的版本更新,及时跟进。

总结

这篇文章详细拆解了OpenClaw配置国内五大主流大模型(MiniMax、GLM、Kimi、Doubao、Qwen)的完整方法,所有配置命令模板都可以直接复制使用,配置文件的操作也一并给出了。

国内大模型技术的发展速度有目共睹,建议开发者定期留意各平台官方文档的更新,获取最新的定价和功能信息。OpenClaw作为开源AI助手框架,为开发者提供了灵活的多模型集成方案。把不同模型的优势组合起来,能让AI助手发挥出更大的价值。

免责声明:文中图文均来自网络,如有侵权请联系删除,心愿游戏发布此文仅为传递信息,不代表心愿游戏认同其观点或证实其描述。

相关文章

更多

精选合集

更多

大家都在玩

热门话题

大家都在看

更多