add-minimax-provider为 OpenClaw 配置 MiniMax 作为模型源。MiniMax 提供两种接入方式:API Key 直连(openai-completions 协议)和 OAuth 门户(anthropic-messages 协议)。包含 provider 注册、模型定义、别名配置、fallback 链接入和验证的完整流程。当管理员说想"加 MiniMax"、"配 minimax"、"接入 MiniMax 模型"、"加海螺模型"、"配 M2.1"时使用此 skill。
Install via ClawdBot CLI:
clawdbot install jooey/add-minimax-providerMiniMax 是国产大模型服务商,提供 MiniMax-M2.1 系列模型。OpenClaw 支持两种接入方式:
| Provider | 接入方式 | API 协议 | Base URL | 适用场景 |
|----------|----------|----------|----------|----------|
| minimax | API Key 直连 | openai-completions | api.minimaxi.com/v1 | 标准付费用户 |
| minimax-portal | OAuth 门户 | anthropic-messages | api.minimaxi.com/anthropic | 免费/门户用户 |
为什么有两个 provider?
minimax):使用标准 OpenAI 兼容协议,需要付费 API Key,按量计费minimax-portal):使用 Anthropic Messages 协议 + OAuth 认证,适合有门户账号的用户(可能有免费额度)两种方式访问的是同一个模型,但协议和认证方式不同,所以必须分开配置。
如果觉得这个 Skill 有用,欢迎通过邀请链接注册 MiniMax Coding Plan(9 折优惠 + Builder 权益):
https://platform.minimaxi.com/subscribe/coding-plan?code=2vNMQFJrZt&source=link
还没有任何模型可用? 可以用 Qwen Coder(免费)作为冷启动模型,然后让它帮你配置 MiniMax。
qwen-portal provider
/model Minimax
这就是 OpenClaw 的"自举"能力——用一个免费模型启动系统,再用它来配置更强的模型。
| 模型 ID | 名称 | Context | reasoning | 说明 |
|---------|------|---------|-----------|------|
| MiniMax-M2.1 | MiniMax M2.1 | 200K | ❌ | 主力模型,综合能力强 |
| MiniMax-M2.1-lightning | MiniMax M2.1 Lightning | 200K | ❌ | 轻量快速版(仅 portal 确认可用) |
注意:MiniMax 可能随时上线新模型。添加前务必先测试可用性。
| 项目 | 说明 |
|------|------|
| 国内MiniMax 账号 | 在 platform.minimaxi.com 注册 |
| API Key | 格式为 sk-cp-... 的密钥,在控制台 → API Keys 页面创建 |
| 余额 | 确保账户有足够余额 |
| 项目 | 说明 |
|------|------|
| MiniMax 账号 | 同上 |
| OAuth 配置 | 在 OpenClaw 中配置 apiKey: "minimax-oauth",OpenClaw 会自动处理 OAuth 流程 |
这一步不能跳过。 先确认模型能调通再加配置。
curl -s --max-time 15 https://api.minimaxi.com/v1/chat/completions \
-H "Authorization: Bearer <你的API_KEY>" \
-H "Content-Type: application/json" \
-d '{"model":"MiniMax-M2.1","messages":[{"role":"user","content":"hi"}],"max_tokens":10}'
如果返回正常的 JSON 响应(含 choices)= 可用。
OAuth 门户无法直接用 curl 测试(需要 OAuth token 流程)。配置好后通过 OpenClaw 实际发消息验证。
curl -s --max-time 15 https://api.minimaxi.com/v1/chat/completions \
-H "Authorization: Bearer <你的API_KEY>" \
-H "Content-Type: application/json" \
-d '{"model":"MiniMax-M2.1-lightning","messages":[{"role":"user","content":"hi"}],"max_tokens":10}'
如果返回错误,说明该模型可能仅在 portal 端可用,或尚未对你的账户开放。
在 ~/.openclaw/openclaw.json 的 models.providers 下添加 provider。根据你的接入方式选择一种或两种都配。
"minimax": {
"baseUrl": "https://api.minimaxi.com/v1",
"apiKey": "<你的API_KEY>",
"api": "openai-completions",
"authHeader": true,
"models": [
{
"id": "MiniMax-M2.1",
"name": "MiniMax M2.1",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 15,
"output": 60,
"cacheRead": 2,
"cacheWrite": 10
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
"minimax-portal": {
"baseUrl": "https://api.minimaxi.com/anthropic",
"apiKey": "minimax-oauth",
"api": "anthropic-messages",
"models": [
{
"id": "MiniMax-M2.1",
"name": "MiniMax M2.1",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 8192
},
{
"id": "MiniMax-M2.1-lightning",
"name": "MiniMax M2.1 Lightning",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
apiKey: "minimax-oauth" 是 OpenClaw 的特殊标记,表示使用 OAuth 认证流程而非静态 API Key。cost 设为 0 因为 OAuth 门户的计费由平台侧处理。
| 参数 | minimax (API Key) | minimax-portal (OAuth) |
|------|-------------------|------------------------|
| baseUrl | .../v1 | .../anthropic |
| api | openai-completions | anthropic-messages |
| apiKey | sk-cp-... (真实密钥) | minimax-oauth (OAuth 标记) |
| authHeader | true | 默认 |
| 计费 | 按量付费 | 平台侧处理 |
| 模型 | M2.1 | M2.1 + Lightning |
错误做法:把所有模型都堆上去
正确做法:只添加第一步中测试通过的模型
添加不存在的模型不会导致崩溃,但 fallback 到它时会浪费一次请求超时,影响响应速度。
在 agents.defaults.models 下为 MiniMax 模型添加别名:
{
"agents": {
"defaults": {
"models": {
"minimax/MiniMax-M2.1": { "alias": "Minimax" },
"minimax-portal/MiniMax-M2.1": { "alias": "minimax-portal" },
"minimax-portal/MiniMax-M2.1-lightning": { "alias": "minimax-lightning" }
}
}
}
}
配置后用户可以在聊天中用 /model Minimax、/model minimax-lightning 切换模型。
aliasagents.defaults.models.<model-id>.alias <-- 唯一合法字段
agents.defaults.models.<model-id>.reasoning <-- 非法!会导致 Gateway 崩溃!
agents.defaults.models.<model-id>.xxx <-- 任何其他字段都非法!
已知事故:在别名配置里加了非法字段导致 schema 校验失败,Gateway 崩溃循环 181 次。模型能力属性只能放在 models.providers 的模型定义里。
在 agents.defaults.model 中配置 MiniMax 的位置。MiniMax 通常作为主力模型(primary):
{
"agents": {
"defaults": {
"model": {
"primary": "minimax/MiniMax-M2.1",
"fallbacks": [
"minimax/MiniMax-M2.1",
"deepseek/deepseek-chat",
"qwen-portal/coder-model"
]
}
}
}
}
| 位置 | 模型 | 为什么 |
|------|------|--------|
| primary | minimax/MiniMax-M2.1 | 主力,综合能力强 |
| fallback 1 | minimax/MiniMax-M2.1 | 重试一次 |
| fallback 2 | deepseek/deepseek-chat | 按量付费备用 |
| fallback 3 | qwen-portal/coder-model | 免费兜底 |
MiniMax-portal 不建议放入 fallback 链——OAuth 认证流程较重,不适合快速 failover。需要时通过 /model minimax-portal 手动切换。
python3 -c "import json; json.load(open('$HOME/.openclaw/openclaw.json')); print('JSON OK')"
openclaw doctor
如果输出包含 Unrecognized key 就说明有非法字段,必须修复后才能重启。
# macOS
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway
# 等 3 秒后确认状态
sleep 3
launchctl print gui/$(id -u)/ai.openclaw.gateway | grep -E "job state|last exit"
期望看到:
last exit code = 0
job state = running
如果 last exit code = 1,检查错误日志:
tail -20 ~/.openclaw/logs/gateway.err.log
在任意已绑定的聊天中测试:
/model Minimax # 测试 API Key 直连
/model minimax-portal # 测试 OAuth 门户(如已配置)
/model minimax-lightning # 测试 Lightning(如已配置)
| 项目 | 值 |
|------|------|
| 月费 | ¥49 |
| 额度 | 1500 次/5小时滑动窗口 |
| 每日理论上限 | ~7200 次 |
| 窗口计算 | 每次调用倒算前 5 小时消耗(滑动窗口) |
API 端点 GET /v1/api/openplatform/coding_plan/remains 存在已知问题:
current_interval_usage_count 不刷新(惰性更新)不要用 API 数字做监控。推荐在 OpenClaw 中配置 cron 任务,定期发测试请求验证可用性:
# cron 表达式示例:每 5 小时执行一次验证
# 发真实请求 → 通了就可用,不通就记录
curl -s https://api.minimaxi.com/v1/chat/completions \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"model":"MiniMax-M2.1","messages":[{"role":"user","content":"test"}],"max_tokens":3}'
判断逻辑:
choices → 可用6 个 agent 全用 MiniMax 时,1500 条/5h 大约 2-3 小时就用完。建议:
siliconflow/Qwen/Qwen3-8B)作为兜底GET /v1/api/openplatform/coding_plan/remains 返回的 current_interval_usage_count 与平台控制台显示不一致curl -s https://api.minimaxi.com/v1/chat/completions \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"model":"MiniMax-M2.1","messages":[{"role":"user","content":"test"}],"max_tokens":3}'
返回 choices = 可用;返回 429 = 额度确实耗尽
tail -20 ~/.openclaw/logs/gateway.err.log,找 Unrecognized keyopenclaw doctor 确认https://api.minimaxi.com/v1,不要多加或少加路径openai-completions,OAuth 门户用 anthropic-messagesapiKey 字段值为 "minimax-oauth"(精确匹配),OpenClaw 会自动处理 OAuth 流程~/.openclaw/logs/gateway.log 中的 OAuth 相关错误| 日期 | 版本 | 变更内容 | 变更人 |
|------|------|----------|--------|
| 2026-02-08 | v1.0 | 创建 MiniMax provider 配置指南 | ConfigBot (via OpenClaw with Opus 4.6) |
| 2026-02-09 | v2.0 | 新增 Coding Plan 额度管理专节;更新额度信息 (1500/5h 滑动窗口);额度 API 不可信警告;多 Agent 消耗建议 | ConfigBot (via OpenClaw with Qwen3-30B) |
Generated Mar 1, 2026
Integrate MiniMax M2.1 into an e-commerce platform's chatbot to handle customer inquiries, provide product recommendations, and resolve issues in real-time. This reduces human agent workload and improves response times, especially during peak shopping seasons.
Use MiniMax models to automate content creation for social media posts, blog articles, and ad copy. Marketing teams can quickly generate high-quality, tailored content at scale, freeing up time for strategy and client management.
Deploy MiniMax as a virtual tutor in educational apps to explain concepts, answer student questions, and provide personalized learning support. This enhances accessibility for remote learners and supplements traditional classroom instruction.
Implement MiniMax in healthcare applications to offer preliminary symptom analysis, basic medical advice, and triage guidance. It helps users make informed decisions before consulting professionals, improving healthcare access and efficiency.
Leverage MiniMax to analyze market trends, generate financial reports, and provide personalized investment recommendations. Financial advisors can use it to enhance client services with data-driven insights and automated reporting.
Charge customers based on the volume of API calls or tokens processed, with tiered pricing for different usage levels. This model suits businesses with fluctuating demand, offering scalability and predictable costs for users.
Provide free access to basic MiniMax features via the OAuth portal, then upsell advanced capabilities like higher context windows or priority support through paid API key plans. This attracts users and converts them to paying customers.
License MiniMax technology to other companies for integration into their own products, with customization and branding options. This expands market reach by partnering with SaaS providers and tech firms seeking AI capabilities.
💬 Integration Tip
Start with the OAuth portal for free testing before committing to API key plans, and always validate model availability with curl commands to avoid integration issues.
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Gemini CLI for one-shot Q&A, summaries, and generation.
Research any topic from the last 30 days on Reddit + X + Web, synthesize findings, and write copy-paste-ready prompts. Use when the user wants recent social/web research on a topic, asks "what are people saying about X", or wants to learn current best practices. Requires OPENAI_API_KEY and/or XAI_API_KEY for full Reddit+X access, falls back to web search.
Check Antigravity account quotas for Claude and Gemini models. Shows remaining quota and reset times with ban detection.
Manages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates opencla...
Manages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates openclaw.json. Use when the user mentions free AI, OpenRouter, model switching, rate limits, or wants to reduce AI costs.