OpenClaw 配置 MiniMax M2.5 避坑指南
OpenClaw2026.3.13 配置 MiniMax M2.5 避坑指南
═══════════════════════════════════════════════════════════════
一、套餐说明
MiniMax Coding Plan(开发套餐)
├─ Starter 月度套餐:40 prompts / 5小时
├─ 支持 MiniMax M2.5(最新模型)
├─ 正常 50TPS,低峰 100TPS
├─ 支持图像理解、联网搜索 MCP
└─ 获取地址:https://platform.minimax.io/subscribe/coding-plan
⚠️ 关键:Coding Plan 的 API Key 是中国版(minimaxi.com),
不是国际版(minimax.io)!
═══════════════════════════════════════════════════════════════
二、模型显示问题
❌ 误区:
- models.mode 只有 "merge" 和 "replace",没有 "override"
- "replace" 仍会显示内置模型,无法完全禁用
- 白名单 agents.defaults.models 格式复杂,容易配错
✅ 结论:
OpenClaw 无法完全限制只显示 2 个模型,这是设计限制
═══════════════════════════════════════════════════════════════
三、MiniMax M2.5 API 配置关键点
┌─────────────┬────────────────────────────────────────┬────────────────────────────────────┐
│ 配置项 │ 错误值 │ 正确值 │
├─────────────┼────────────────────────────────────────┼────────────────────────────────────┤
│ api │ "openai-completions" │ "anthropic-messages" │
├─────────────┼────────────────────────────────────────┼────────────────────────────────────┤
│ baseUrl │ https://api.minimaxi.com/v1/... │ https://api.minimaxi.com/anthropic │
│ │ ?GroupId=xxx │ │
├─────────────┼────────────────────────────────────────┼────────────────────────────────────┤
│ apiKey │ 旧 Key │ 重置后的新 Key │
├─────────────┼────────────────────────────────────────┼────────────────────────────────────┤
│ 区域 │ Global (minimax.io) │ CN (minimaxi.com) │
│ │ (国际版不兼容 Coding Plan) │ (Coding Plan 必须用这个) │
└─────────────┴────────────────────────────────────────┴────────────────────────────────────┘
═══════════════════════════════════════════════════════════════
四、API Key 问题
⚠️ 注意:
- 首次显示的 Key 可能无效,必须点击"重置"生成新 Key
- Key 格式:sk-cp- 开头
- Coding Plan 的 Key 只能用于中国版端点(minimaxi.com)
═══════════════════════════════════════════════════════════════
五、配置结构
❌ 错误:
- 顶层 "providers"
- "default_model"
- base_url / api_key(下划线命名)
✅ 正确:
- "models": { "providers": {} }
- "agents": { "defaults": { "model": { "primary": "..." } } }
- baseUrl / apiKey(驼峰命名)
═══════════════════════════════════════════════════════════════
六、验证流程
# 1. 先 curl 测试 API Key 是否有效(Coding Plan 用这个端点)
curl -X POST "https://api.minimaxi.com/v1/text/chatcompletion_v2?GroupId=你的GroupId" \
-H "Authorization: Bearer sk-cp-你的Key" \
-H "Content-Type: application/json" \
-d '{"model":"MiniMax-M2.5","messages":[{"role":"user","content":"你好"}]}'
# 2. 配置 OpenClaw(anthropic-messages + /anthropic 端点)
# 3. 重启网关
openclaw gateway restart
# 4. 查看模型列表
openclaw models list
# 5. 测试对话
openclaw chat "你好"
═══════════════════════════════════════════════════════════════
七、最终可用配置(Coding Plan 简化版)
{
"models": {
"mode": "replace",
"providers": {
"minimax-cn": {
"baseUrl": "https://api.minimaxi.com/anthropic",
"apiKey": "sk-cp-你的Key",
"api": "anthropic-messages",
"models": [{
"id": "MiniMax-M2.5",
"name": "MiniMax M2.5",
"reasoning": true,
"input": ["text"],
"contextWindow": 200000
}]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "minimax-cn/MiniMax-M2.5" }
}
}
}
═══════════════════════════════════════════════════════════════
核心教训
1. MiniMax M2.5 需要 Coding Plan 订阅
2. Coding Plan 必须用中国版(minimaxi.com),不能用国际版
3. 在 OpenClaw 中必须用 anthropic-messages 和 /anthropic 端点
4. 不能用标准的 OpenAI 格式(/v1/text/chatcompletion_v2 只用于 curl 测试)
