Skip to main content

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
  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).
{
  "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-M2.1",
    "ANTHROPIC_SMALL_FAST_MODEL": "MiniMax-M2.1",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M2.1",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M2.1",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M2.1"
  }
}
  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.

Use M2.1 in Claude Code Extension for VS Code

  1. Install Claude Code Extension for VS Code
  1. After installation, click Settings
  1. Configure the model to MiniMax-M2.1
  • In Settings - Claude Code: Selected Model, enter MiniMax-M2.1
Or
  • Click Edit in settings.json, modify claude-code.selectedModel to MiniMax-M2.1 in the configuration file.
  1. Configure the environment variables
  • If Claude Code is already installed, please refer to the configuration above for environment variable settings.
  • If Claude Code is not installed, click Edit in settings.json
  • Then modify claudeCode.environmentVariables to following settings.
  • The ANTHROPIC_BASE_URL value 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
"claudeCode.environmentVariables": [
        {
            "name": "ANTHROPIC_BASE_URL",
            "value": "https://api.minimax.io/anthropic"
        },
        {
            "name": "ANTHROPIC_AUTH_TOKEN",
            "value": "<MINIMAX_API_KEY>"
        },
        {
            "name": "API_TIMEOUT_MS",
            "value": "3000000"
        },
        {
            "name": "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC",
            "value": "1"
        },
        {
            "name": "ANTHROPIC_MODEL",
            "value": "MiniMax-M2.1"
        },
        {
            "name": "ANTHROPIC_SMALL_FAST_MODEL",
            "value": "MiniMax-M2.1"
        },
        {
            "name": "ANTHROPIC_DEFAULT_SONNET_MODEL",
            "value": "MiniMax-M2.1"
        },
        {
            "name": "ANTHROPIC_DEFAULT_OPUS_MODEL",
            "value": "MiniMax-M2.1"
        },
        {
            "name": "ANTHROPIC_DEFAULT_HAIKU_MODEL",
            "value": "MiniMax-M2.1"
        }
    ],