M2 for AI Coding Tools
How to plug MiniMax-M2 into popular AI coding assistants and IDE extensions.
M2 for AI Coding Tools
MiniMax-M2 exposes both OpenAI-compatible (chat completions) and Claude-compatible (messages) endpoints, making it simple to drop into existing AI coding workflows. This guide walks through common tools and configuration patterns.
1. Claude-Code (Recommended)
Claude Code reads its provider configuration from ~/.claude/settings.json. In this file, add or update the env field as shown below. Set MINIMAX_API_KEY to the API key obtained from the minimax-m2.com.
Save the file and restart Claude Code. Every inline edit, “fix”, or chat request will now hit https://minimax-m2.com/api/v1/messages with the Anthropic-compatible schema.
2. Codex
Install codex
Configure MiniMax API
- Add the following configuration to the .codex/config.toml file:
- Set the API key using environment variables in the current terminal session for security reasons. Use the API key obtained from the minimax-m2.com as the value for MINIMAX_API_KEY.
- Start the Codex CLI with the specified profile.