Skip to main content
Claude Code is Anthropic’s official terminal-native coding agent powered by Claude.

Install Claude Code

Refer to the Claude Code documentation for installation.

Configure MiniMax API

Important: Clear Anthropic Environment Variables Before ConfigurationBefore configuring, ensure you clear the following Anthropic-related environment variables to avoid conflicts with MiniMax API:
  • ANTHROPIC_AUTH_TOKEN
  • ANTHROPIC_BASE_URL
unset ANTHROPIC_AUTH_TOKEN
unset ANTHROPIC_BASE_URL
If you previously exported these in ~/.bashrc or ~/.zshrc, also remove the export lines there to prevent re-export in new shells.
  1. Edit or create the Claude Code configuration file located at ~/.claude/settings.json. In this file, add or update the env field as shown below.
  • The ANTHROPIC_BASE_URL should be set based on your location: for international users, use https://api.minimax.io/anthropic; for users in China, use https://api.minimaxi.com/anthropic.
  • Set <MINIMAX_API_KEY> to the API Key obtained from the MiniMax Developer Platform (For users in China, visit MiniMax Developer Platform).
  • Note: Environment variables ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL take priority over settings.json configuration.
  • CLAUDE_CODE_AUTO_COMPACT_WINDOW sets Claude Code’s auto-compact threshold to 512000 tokens, matching MiniMax-M3’s current context window.
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.minimax.io/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "<MINIMAX_API_KEY>",
    "API_TIMEOUT_MS": "3000000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "ANTHROPIC_MODEL": "MiniMax-M3",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M3",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M3",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M3",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "512000"
  }
}
  1. After completing the configuration, navigate to your working directory and run the claude command in the terminal to start using Claude Code. After startup, select Trust This Folder to allow it to access the files in your folder as shown below:
claude-trust
  1. You can now start using Claude Code for development.
Important Note:After completing the configuration, if you also want to enable Web Search capability, you will need to follow this tutorial to configure the Web Search MCP.

Verify the Configuration

After starting claude, run the following slash commands inside the TUI to confirm Claude Code is using MiniMax instead of the default Claude provider:
/status
/model
  • /status should show the ANTHROPIC_BASE_URL pointing to api.minimax.io/anthropic (or api.minimaxi.com/anthropic for users in China).
  • /model should show the active model as MiniMax-M3.
MiniMax-M3 supports Claude Code’s extended thinking, which is on by default — toggle it anytime with Option+T (macOS) or Alt+T (Windows/Linux), or via /config.