πŸ”§ Error Fixes
Β· 1 min read

MiniMax API Authentication Fix: API Key Setup (2026)


MiniMax returned an authentication error:

Error: Invalid API key

Here is how to fix it.

Fix 1: Verify API key

# Check if key is set
echo $MINIMAX_API_KEY

# Test the key
curl https://api.minimax.chat/v1/models \
  -H "Authorization: Bearer $MINIMAX_API_KEY"

Fix 2: Generate new key

  1. Go to platform.minimax.chat
  2. Navigate to API Keys
  3. Create a new key
  4. Copy and save it
export MINIMAX_API_KEY="your-new-key"

Fix 3: Check key format

MiniMax keys have a specific format:

# Correct format
api_key = "your-group-id:your-api-key"

# Not just the API key

Fix 4: Check account status

# Check account balance
curl https://api.minimax.chat/v1/usage \
  -H "Authorization: Bearer $MINIMAX_API_KEY"

Add credit at platform.minimax.chat if needed.

Fix 5: Verify endpoint

# Correct endpoint
client = openai.OpenAI(
    base_url="https://api.minimax.chat/v1",
    api_key="your-group-id:your-api-key"
)

Fix 6: Check permissions

Some keys have restricted access:

# Test with full permissions
curl https://api.minimax.chat/v1/chat/completions \
  -H "Authorization: Bearer $MINIMAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"abab6.5-chat","messages":[{"role":"user","content":"test"}]}'

Still not working?

  1. Regenerate key β€” Create fresh API key
  2. Check email β€” Account verification may be required
  3. Contact support β€” platform.minimax.chat/support
  4. Use OpenRouter β€” Alternative access method

FAQ

How do I get a MiniMax API key?

Go to platform.minimax.chat, create an account, navigate to API Keys, and create a new key. MiniMax keys have a specific format: group-id:api-key.

Why is my API key not working?

MiniMax keys require both a group ID and API key separated by a colon. Check that you have the full key in the correct format. Also verify your account has credit and the key has not expired.

Can I use MiniMax API for free?

MiniMax offers a free tier with limited requests. For higher usage, you need to add credit to your account. See our AI API Pricing guide for details.

Related: MiniMax M3 Complete Guide Β· Best Chinese AI Models 2026 Β· AI API Pricing Compared 2026 Β· OpenRouter Complete Guide