Skip to content

Setting up MiniMax M2.1 with OpenClaw

I often find myself frustrated when a coding assistant starts wasting tokens on long-winded explanations or struggles with complex multi-language projects. I want a model that gets straight to the point and handles languages like Rust or Go without me having to fix basic syntax errors.

MiniMax M2.1 is built for these real-world tasks. It focuses on concise responses and better tool compatibility, making it a great choice for app development or office-style workflows. I’ve found its ability to handle composite instructions particularly helpful when I need to manage tight constraints.

  • An active MiniMax Coding Plan (for OAuth) or a MiniMax API Key.
  • OpenClaw installed on your machine.
  • LM Studio (only if you plan to run it locally).

I recommend the OAuth method if you have a MiniMax Coding Plan. It is the fastest way to get running without managing API keys.

  1. Enable the plugin and restart the gateway:

    Terminal window
    openclaw plugins enable minimax-portal-auth
    openclaw gateway restart
  2. Run the onboarding command:

    Terminal window
    openclaw onboard --auth-choice minimax-portal
  3. Select your endpoint:

    • Global: International users (api.minimax.io)
    • CN: Users in China (api.minimaxi.com)

If you prefer using an API key or need a fallback configuration, you can use the interactive CLI or edit your config file directly.

  1. Run openclaw configure.
  2. Select Model/auth.
  3. Choose MiniMax M2.1.
  4. Follow the prompts to set your default model.

For a hosted setup using the Anthropic-compatible API, add this to your openclaw.json:

{
env: { MINIMAX_API_KEY: "sk-..." },
agents: { defaults: { model: { primary: "minimax/MiniMax-M2.1" } } },
models: {
mode: "merge",
providers: {
minimax: {
baseUrl: "https://api.minimax.io/anthropic",
apiKey: "${MINIMAX_API_KEY}",
api: "anthropic-messages",
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,
},
],
},
},
},
}

If you want to keep Claude Opus 4.6 as your primary model but have MiniMax M2.1 take over if the first one fails, use this structure:

{
env: { MINIMAX_API_KEY: "sk-..." },
agents: {
defaults: {
models: {
"anthropic/claude-opus-4-6": { alias: "opus" },
"minimax/MiniMax-M2.1": { alias: "minimax" },
},
model: {
primary: "anthropic/claude-opus-4-6",
fallbacks: ["minimax/MiniMax-M2.1"],
},
},
},
}

I’ve seen this happen when the MiniMax provider isn’t detected. This usually means the provider entry is missing or the environment key isn’t set. You can fix this by:

  • Upgrading to version 2026.1.12 or later and restarting the gateway.
  • Running openclaw configure and selecting MiniMax M2.1.
  • Manually adding the models.providers.minimax block to your config.

Remember that model IDs are case-sensitive. Use minimax/MiniMax-M2.1 or minimax/MiniMax-M2.1-lightning. You can verify your setup with:

Terminal window
openclaw models list

If you need more help with your specific configuration, check out the AI Setup Assistant.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.