#How do I update the MiniMax API key and set MiniMax M2.7 as the primary model for all agents in open
1 messages · Page 1 of 1 (latest)
Yep — for OpenClaw 2026.4.5, this is the correct openclaw.json structure for:
- updating MiniMax API key, and
- setting MiniMax M2.7 as primary for all agents.
{
env: {
// 1) Put your new key here
MINIMAX_API_KEY: "sk-REPLACE_WITH_NEW_KEY",
},
agents: {
defaults: {
// 2) Primary model for all agents (unless an agent overrides model)
model: {
primary: "minimax/MiniMax-M2.7",
},
// Optional but recommended: keep MiniMax models in your model allowlist/aliases
models: {
"minimax/MiniMax-M2.7": { alias: "minimax" },
"minimax/MiniMax-M2.7-highspeed": { alias: "minimax-fast" },
},
},
// If any agents.list[].model exists, that agent overrides defaults.
// Remove per-agent overrides if you want ALL agents on MiniMax-M2.7.
},
models: {
mode: "merge",
providers: {
minimax: {
baseUrl: "https://api.minimax.io/anthropic",
apiKey: "${MINIMAX_API_KEY}",
api: "anthropic-messages",
models: [
{
id: "MiniMax-M2.7",
name: "MiniMax M2.7",
reasoning: true,
input: ["text", "image"],
cost: { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0.375 },
contextWindow: 204800,
maxTokens: 131072,
},
{
id: "MiniMax-M2.7-highspeed",
name: "MiniMax M2.7 Highspeed",
reasoning: true,
input: ["text", "image"],
cost: { input: 0.6, output: 2.4, cacheRead: 0.06, cacheWrite: 0.375 },
contextWindow: 204800,
maxTokens: 131072,
},
],
},
},
},
}
If you use the China endpoint, swap only this line:
baseUrl: "https://api.minimaxi.com/anthropic"
Docs (2026.4.5-compatible keys):
- https://docs.openclaw.ai/providers/minimax
- https://docs.openclaw.ai/gateway/configuration-reference
- https://docs.openclaw.ai/concepts/models
If you want, I can also give you a minimal-diff patch version (just the few lines to change from your current config).
I updated agents.defaults.model.primary to minimax/MiniMax-M2.7 and removed all per-agent model overrides in agents.list, but my agents are still responding with DeepSeek. The model-picker-preferences.json in the discord folder may also be overriding this. How do I force all channels (Telegram and Discord) to use MiniMax M2.7? What takes priority — agents.defaults, per-agent config, or model-picker-preferences.json?
You’re on the right track — this is almost certainly a persisted session override, not agents.defaults.
Priority order (effective model resolution)
For normal chat runs, the practical precedence is:
- Session model override (stored in session state, usually from
/modelor picker submit) channels.modelByChannel(only if no session override)- Per-agent model (
agents.list[].model, for the routed agent) - Global default (
agents.defaults.model.primary)
And importantly:
discord/model-picker-preferences.jsonis recents/history for picker UX only (quick models), not the active model source.
Why you still see DeepSeek
Existing Discord/Telegram sessions likely still have modelOverride/providerOverride persisted (DeepSeek), so they keep winning over your new defaults.
How to force MiniMax M2.7 everywhere
- Keep global default set:
agents.defaults.model.primary = "minimax/MiniMax-M2.7"
- Make sure routed agents don’t override:
- no
agents.list[].modelfor those agents
- Clear existing session overrides (this is the key):
- start fresh sessions with
/newin each active Discord thread/channel and Telegram chat/topic - or clear model override to inherit in Sessions UI
- or set each active session explicitly once:
/model minimax/MiniMax-M2.7
- Optional hard pin by channel (if you want per-channel enforcement for new sessions):
{
channels: {
modelByChannel: {
discord: {
"123456789012345678": "minimax/MiniMax-M2.7"
},
telegram: {
"-1001234567890": "minimax/MiniMax-M2.7",
"-1001234567890:topic:99": "minimax/MiniMax-M2.7"
}
}
}