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.
What You’ll Need
Section titled “What You’ll Need”- 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).
Quick Start
Section titled “Quick Start”I recommend the OAuth method if you have a MiniMax Coding Plan. It is the fastest way to get running without managing API keys.
-
Enable the plugin and restart the gateway:
Terminal window openclaw plugins enable minimax-portal-authopenclaw gateway restart -
Run the onboarding command:
Terminal window openclaw onboard --auth-choice minimax-portal -
Select your endpoint:
- Global: International users (
api.minimax.io) - CN: Users in China (
api.minimaxi.com)
- Global: International users (
Choose Your Setup
Section titled “Choose Your Setup”If you prefer using an API key or need a fallback configuration, you can use the interactive CLI or edit your config file directly.
Option 1: Using the CLI Wizard
Section titled “Option 1: Using the CLI Wizard”- Run
openclaw configure. - Select Model/auth.
- Choose MiniMax M2.1.
- Follow the prompts to set your default model.
Option 2: Manual API Configuration
Section titled “Option 2: Manual API Configuration”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, }, ], }, }, },}Option 3: Fallback Setup
Section titled “Option 3: Fallback Setup”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"], }, }, },}Troubleshooting
Section titled “Troubleshooting”“Unknown model: minimax/MiniMax-M2.1”
Section titled ““Unknown model: 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 configureand selecting MiniMax M2.1. - Manually adding the
models.providers.minimaxblock 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:
openclaw models listIf you need more help with your specific configuration, check out the AI Setup Assistant.
What’s Next
Section titled “What’s Next”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.