Official: MiniMax M2.1 Configuration for AI Coding Tools

Official configuration guide for using MiniMax M2.1 with agentic coding tools. Includes API setup, timeout settings, and recommended parameters.

RRuleBoxยทvia MiniMax
ยทDec 24, 2025ยท22 views
# MiniMax M2.1 for AI Coding Tools

Official configuration guide for using MiniMax-M2.1 with Claude Code, Cline, Kilo Code, Roo Code, and other agentic coding assistants.

## Quick Start

### API Configuration

**Base URL (International):**
```
https://api.minimax.io/anthropic
```

**Base URL (China):**
```
https://api.minimaxi.com/anthropic
```

### Environment Setup

Clear any conflicting variables first:

```bash
unset ANTHROPIC_AUTH_TOKEN
unset ANTHROPIC_BASE_URL
```

Then set MiniMax credentials:

```bash
export ANTHROPIC_API_KEY="your-minimax-api-key"
export ANTHROPIC_BASE_URL="https://api.minimax.io/anthropic"
export API_TIMEOUT_MS=3000000  # 50 min for extended reasoning
```

## Claude Code Configuration

Add to `~/.claude/settings.json`:

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.minimax.io/anthropic",
    "API_TIMEOUT_MS": "3000000"
  },
  "model": "MiniMax-M2.1",
  "smallFastModel": "MiniMax-M2.1"
}
```

## Recommended Parameters

MiniMax recommends these inference settings:

| Parameter | Value |
|-----------|-------|
| Temperature | 1.0 |
| Top-p | 0.95 |
| Top-k | 40 |

## System Prompt

Default system prompt:

```
You are a helpful assistant. Your name is MiniMax-M2.1 and is built by MiniMax.
```

## Interleaved Thinking

M2.1 uses `<think>` blocks for reasoning before tool calls. This is enabled by default and improves multi-step problem solving.

**Important:** Preserve reasoning between turns to maintain performance. Don't strip `<think>` blocks from context.

## Tool Calling

M2.1 is optimized for agentic workflows:
- Robust tool use and instruction following
- Long-horizon planning
- Multi-step reasoning with transparency

## Cline / Kilo Code / Roo Code

These tools support native MiniMax provider integration. Use the secure prompt method instead of exposing API keys in config files.

## Troubleshooting

**Timeout errors:** Increase `API_TIMEOUT_MS` to at least 3000000 (50 minutes)

**Auth conflicts:** Ensure `ANTHROPIC_AUTH_TOKEN` is unset - it conflicts with `ANTHROPIC_API_KEY`

**Slow responses:** M2.1 uses extended thinking. This is normal for complex tasks.

## Resources

- [GitHub](https://github.com/MiniMax-AI/MiniMax-M2.1)
- [API Documentation](https://platform.minimax.io/docs/guides/text-generation)
- [Hugging Face](https://huggingface.co/MiniMaxAI/MiniMax-M2.1)

Comments

No comments yet

Be the first to share your thoughts!