Skip to main content
MiniMax Open Platform offers two billing options for text models: Coding Plan and Pay-As-You-Go. You can choose flexibly based on your usage requirements.
The billing model is determined by the API Key you use. Different types of keys will trigger different billing methods.

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).
  • Note: Environment variables ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL take priority over settings.json configuration.
{
  "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 Plugin

Install Claude Code Extension for VS Code
2

Open Settings

After installation, click Settings
3

Configure Model

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.
4

Configure Environment Variables

  • If Claude Code is already installed, please refer to the Claude Code Configuration to configure the environment variables.
  • If Claude Code is not installed, click Edit in settings.json
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"
        }
    ],

Use MiniMax-M2.1 in Cursor

Install Cursor

  1. Download and install Cursor from the Cursor website.
  2. Open Cursor, click the “Settings” button in the top-right corner to enter the settings page.
  3. Click the “Sign in” button to log in to your Cursor account.
cursor-install

Configure MiniMax API

Important: Clear OpenAI Environment Variables Before ConfigurationBefore configuring, ensure you clear the following OpenAI-related environment variables to avoid conflicts with MiniMax API:
  • OPENAI_API_KEY
  • OPENAI_BASE_URL
  1. Click “Models” in the left sidebar to open the model configuration page.
  2. Expand the “API Keys” section and configure the API information:
    • Enable “Override OpenAI Base URL”;
    • Enter the MiniMax base URL (for international users, use https://api.minimax.io/v1; for users in China, use https://api.minimaxi.com/v1)
  3. Paste the API key obtained from the MiniMax Developer Platform (For users in China, visit MiniMax Developer Platform) into the OpenAI API Key field.
  4. Click the button on the right side of the “OpenAI API Key” field.
cursor-configuration
  1. Click the “Enable OpenAI API Key” button in the pop-up window to complete verification.
cursor-verify
  1. In the Models section, click the “View All Models” button, and then click the “Add Custom Model” button.
  1. Enter the model name “MiniMax-M2.1”, then click the “Add” button.
  1. Enable the newly added “MiniMax-M2.1” model.
  2. Select the “MiniMax-M2.1” model in the chat panel and start using “MiniMax-M2.1” for development.

Use MiniMax-M2.1 in TRAE

Install and launch TRAE

1

Download and Install TRAE

Go to TRAE’s website to install TRAE
2

Complete Initial Setup

Click TRAE’s icon to launch it. The following screen appears at TRAE’s first launch
3

Start Setup

Click the Get Started button, TRAE’s setup beginsFor detailed installation steps, please refer to: Trae Setup Guide

Configure MiniMax API

Important: Clear OpenAI Environment Variables Before ConfigurationBefore configuring, ensure you clear the following OpenAI-related environment variables to avoid conflicts with MiniMax API:
  • OPENAI_API_KEY
  • OPENAI_BASE_URL
In TRAE, you can connect to MiniMax M2.1 model using API keys obtained from the MiniMax Developer Platform .
1

Open Settings

At the top right of the side chat box, click Settings icon > Models
2

Select Models Tab

3

Add Model

Click the + Add Model button. The Add Model pop-up appearsEnter Configuration Details:
  • Provider: Select MiniMax-Global
  • Model: Select MiniMax-M2.1
Coding Plan API Key cannot select MiniMax-M2.1-lightning. If you want to use it, please enter a Pay-as-you-go API Key
4

Complete Adding

Click the Add Model button

Use MiniMax-M2.1 in OpenCode

Install OpenCode

  • Install OpenCode using curl:
curl -fsSL https://opencode.ai/install | bash
  • Or install using npm:
npm i -g opencode-ai
For more information, visit OpenCode Official Website

Configure MiniMax API

1

Run Authentication Command

opencode auth login
2

Select Provider

When prompted to select a provider, search and select MiniMax
3

Enter API Key

When prompted, enter your MiniMax API Key
4

Start Using

Return to the command line and enter opencode to start using MiniMax-M2.1
Alternative Configuration Method:
1

Edit Configuration File

Edit the OpenCode configuration file located at ~/.config/opencode/opencode.json, and add the following configuration:
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
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "minimax": {
      "npm": "@ai-sdk/anthropic",
      "options": {
        "baseURL": "https://api.minimax.io/anthropic/v1",
        "apiKey": "<MINIMAX_API_KEY> (Optional)"
      },
      "models": {
        "MiniMax-M2.1": {
          "name": "MiniMax-M2.1"
        }
      }
    }
  }
}
2

Start OpenCode

Navigate to your project directory and start opencode
cd /path/to/your/project

opencode
3

Select Model

Enter /models, select the “MiniMax-M2.1” model to start using it in OpenCode

Use MiniMax-M2.1 in Kilo Code

Install Kilo Code

  1. Open VS Code, click the Extensions icon in the left activity bar, and search for “Kilo Code”.
  2. Click the “Install” button to add the extension. After installation, you may need to restart VS Code.

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. Click the “Settings” button to enter the configuration page.
  1. Under API Provider, select “MiniMax”.
  2. In MiniMax Entrypoint, select the appropriate endpoint based on your location (for international users, select api.minimax.io; for users in China, select api.minimaxi.com)
  3. In MiniMax API Key, enter your API key obtained from MiniMax Developer Platform (For users in China, visit MiniMax Developer Platform)
  4. In Model, select MiniMax-M2.1.
  5. Click “Save” and “Done” buttons in the top-right corner to save the configuration.
  1. Start using “MiniMax-M2.1”.

Use MiniMax-M2.1 in Cline

Install Cline

  1. Open VS Code, click the Extensions icon in the left activity bar, and search for “Cline”.
  2. Click the “Install” button to add the extension. After installation, you may need to restart VS Code.
  1. Once installed, the Cline icon will appear in the left activity bar.
If you already have Cline installed, please upgrade to version 3.47.0 or higher, and restart both the extension and VS code to ensure proper functionality.

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. Click Use your own API key to open Cline’s configuration page.
  2. Under API Provider, select MiniMax.
  3. In MiniMax Entrypoint, select the appropriate endpoint based on your location (for international users, select api.minimax.io; for users in China, select api.minimaxi.com)
  4. In MiniMax API Key, enter your API key.
  5. Click Done in the top-right corner to save the configuration.
  1. Enable the “Edit” option box in “Auto-approve” section and start using “MiniMax-M2.1” for development.

Use MiniMax-M2.1 in Roo Code

Install Roo Code

  1. Open VS Code, click the Extensions icon in the left activity bar, and search for “Roo Code”.
  2. Click the “Install” button to add the extension. After installation, you may need to restart VS Code.

Configure MiniMax API

  1. Click Settings to go to the configuration page.
  1. Under API Provider, select MiniMax.
  2. In MiniMax Entrypoint, select the appropriate endpoint based on your location (for international users, select api.minimax.io; for users in China, select api.minimaxi.com)
  3. In MiniMax API Key, enter the API key from the MiniMax Developer Platform (For users in China, visit MiniMax Developer Platform).
  4. In Model, select MiniMax-M2.1.
  5. Click Save and then Done in the top-right corner to save the configuration.
  1. Start using MiniMax-M2.1 for development.

Install Grok CLI

  1. Install Grok CLI globally using npm:
npm install -g @vibe-kit/grok-cli

Configure MiniMax API

Important: Clear OpenAI Environment Variables Before ConfigurationBefore configuring, ensure you clear the following OpenAI-related environment variables to avoid conflicts with MiniMax API:
  • OPENAI_API_KEY
  • OPENAI_BASE_URL
  1. Configure the URL and API Key through environment variables:
  • Set GROK_BASE_URL based on your location: for international users, use https://api.minimax.io/v1; for users in China, use https://api.minimaxi.com/v1
  • Replace <MINIMAX_API_KEY> with your API Key obtained from MiniMax Developer Platform (For users in China, visit MiniMax Developer Platform)
export GROK_BASE_URL="https://api.minimax.io/v1"
export GROK_API_KEY="<MINIMAX_API_KEY>"
  1. Start Grok CLI with the specified model “MiniMax-M2.1”:
grok --model MiniMax-M2.1
For convenience in integrating the model with Codex CLI, it is recommended to use the model name codex-MiniMax-M2.1. While the model can interact with files through tools like Bash, this approach is not considered best practice for Agent workflows. For optimal Agent development practices, it is recommended to use Claude Code or Cursor tools. The latest version of Codex CLI has compatibility issues and may not work properly. We recommend using version 0.57.0

Install Codex CLI

  1. Install Codex CLI globally using npm:
# Recommended to use version 0.57.0
npm i -g @openai/[email protected]

Configure MiniMax API

Important: Clear OpenAI Environment Variables Before ConfigurationBefore configuring, ensure you clear the following OpenAI-related environment variables to avoid conflicts with MiniMax API:
  • OPENAI_API_KEY
  • OPENAI_BASE_URL
  1. Edit the Codex configuration file located at .codex/config.toml, and add the following configuration:
  • Set base_url based on your location: for international users, use https://api.minimax.io/v1; for users in China, use https://api.minimaxi.com/v1
[model_providers.minimax]
name = "MiniMax Chat Completions API"
base_url = "https://api.minimax.io/v1"
env_key = "MINIMAX_API_KEY"
wire_api = "chat"
requires_openai_auth = false
request_max_retries = 4
stream_max_retries = 10
stream_idle_timeout_ms = 300000

[profiles.m21]
model = "codex-MiniMax-M2.1"
model_provider = "minimax"
  1. For security reasons, set the API Key through an environment variable in the current terminal session. Replace MINIMAX_API_KEY with your API Key obtained from MiniMax Developer Platform (For users in China, visit MiniMax Developer Platform)
export MINIMAX_API_KEY="<MINIMAX_API_KEY>"
  1. Start Codex CLI with the specified configuration file:
codex --profile m21

Use MiniMax-M2.1 in Droid

Install Droid

For Mac/Linux Users:
curl -fsSL https://app.factory.ai/cli | sh
For Windows Users:
irm https://app.factory.ai/cli/windows | iex
For more information, please refer to the Droid documentation.

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. Use following command to edit the configuration file located at ~/.factory/config.json.
  • The 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).
Tips:
  • Config ~/.factory/config.json, NOT ~/.factory/settings.json
  • Clear the ANTHROPIC_AUTH_TOKEN environment variable, otherwise it will override the API key in .factory/config.json and cause errors
{
    "custom_models": [
        {
            "model_display_name": "MiniMax-M2.1",
            "model": "MiniMax-M2.1",
            "base_url": "https://api.minimax.io/anthropic",
            "api_key": "<MINIMAX_API_KEY>",
            "provider": "anthropic",
            "max_tokens": 64000
        }
    ]
}
  1. Navigate to your project and start interactive session
cd /path/to/your/project
droid
  1. Enter /model, select the “MiniMax-M2.1” model and use it in Droid.

Troubleshooting

API Error

API Error: Cannot read properties of undefined (reading 'map')
Please verify the following:
  1. Ensure the API host is set correctly based on your location: for international users, use https://api.minimax.io; for users in China, use https://api.minimaxi.com
  2. Confirm that you have replaced <MINIMAX_API_KEY> with your API key from MiniMax Developer Platform (For users in China, visit MiniMax Developer Platform)
  3. If you are using Claude Code or Droid, clear the environment variable: ANTHROPIC_AUTH_TOKEN
  4. If you are using Claude Code in VS Code or Cursor, please make sure to set the model to MiniMax-M2.1. For more details, see: Using M2.1 in Claude Code for VS Code
  5. Reached the rate limit, please wait and try again later.
If the issue persists, feel free to contact us at: [email protected]