Why Use MiniMax with OpenClaw?
MiniMax is the recommended default model for OpenClaw users, particularly for those in China. Here's why:
- Direct access in China: No VPN required โ connects directly
- Free tier: Every new account receives free token quota to get started
- Long context: MiniMax M2.1 supports up to 200K tokens
- Anthropic API compatibility: Uses the same API format as Claude, making configuration straightforward
- Competitive pricing: Affordable top-up options after the free tier
Step 1: Register a MiniMax Account and Get an API Key
- Visit platform.minimax.io
- Click Sign Up and register with your email or phone
- Complete email / phone verification
- After login, go to API Keys โ Create New Key
- Copy your API Key (starts with
sk-) - Store it securely โ you won't be able to view it again after closing the dialog
Tip: MiniMax automatically grants free token quota to new accounts. Check your quota under Billing โ Free Tier.
Step 2: Configure the Environment Variable
Store your API Key in your environment file rather than directly in the config:
# In ~/.openclaw/.env (or your VPS's .env file)
MINIMAX_API_KEY=sk-your-key-here
Step 3: Configure openclaw.json
Create or edit ~/.openclaw/openclaw.json:
{
"gateway": {
"mode": "local"
},
"env": {
"MINIMAX_API_KEY": "${MINIMAX_API_KEY}"
},
"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
}
]
}
}
}
}
Step 4: Start the Gateway and Verify
# Start the gateway
pnpm openclaw gateway start
# Check status
pnpm openclaw gateway status
# Verify the model is loaded
pnpm openclaw models list
You should see minimax/MiniMax-M2.1 in the model list with "default" status.
Step 5: Test with a Message
Open WebChat at http://127.0.0.1:18789/ and send a test message. If you receive a response, MiniMax is configured correctly.
Common Errors and Solutions
Error: "MINIMAX_API_KEY is not set"
Cause: The environment variable isn't being read correctly.
Solution:
# Check that the variable is set
echo $MINIMAX_API_KEY
# If empty, source your env file
source ~/.openclaw/.env
# Or set it directly in the terminal
export MINIMAX_API_KEY=sk-your-key-here
Error: "401 Unauthorized"
Cause: API Key is invalid or has expired.
Solution:
- Log in to platform.minimax.io โ API Keys
- Check that the key is active (not deleted or disabled)
- Create a new key if needed and update your
.envfile
Error: "429 Rate Limit Exceeded"
Cause: You've hit the rate limit on the free tier.
Solution:
- Check your usage under Billing โ Usage
- If you've exceeded the free quota, add credit to your account
- Or configure a fallback model:
{
"agents": {
"defaults": {
"model": {
"primary": "minimax/MiniMax-M2.1",
"fallback": ["ollama/llama3.3"]
}
}
}
}
Error: "Connection timeout" or "ECONNREFUSED"
Cause: Network issue reaching the MiniMax API endpoint.
Solution:
# Test connectivity
curl -I https://api.minimax.io
# If this fails from China, try the domestic endpoint:
# baseUrl: "https://api.minimax.chat/anthropic"
Error: "Model not found: MiniMax-M2.1"
Cause: Model ID typo or model not yet released in your region.
Solution: Check the exact model ID in platform.minimax.io โ Model Catalog. Supported IDs as of 2026:
MiniMax-M2.1MiniMax-M2.5MiniMax-VL-01(vision model)
Using MiniMax Vision (Image Input)
To enable image analysis with MiniMax:
{
"models": [
{
"id": "MiniMax-VL-01",
"name": "MiniMax VL-01",
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
After configuring, you can send images to OpenClaw via Telegram or WebChat for analysis.
FAQ
Is MiniMax's free quota sufficient for daily use?
For light daily use (a few dozen conversations), yes. For heavier automation tasks or long-document processing, you'll likely need to add credit. Top-up costs are reasonable โ roughly $0.015 per 1,000 input tokens.
Can I use both MiniMax and Claude at the same time?
Yes. Configure both providers and set failover rules โ OpenClaw will use MiniMax as the default and fall back to Claude (or vice versa) when needed.
Does MiniMax work outside China?
Yes, MiniMax's API is accessible globally, though it's primarily designed for Chinese users. International users may prefer Claude or GPT-4o for English-language tasks.