Skip to main content

Get an API Key

  1. Visit the MiniMax Developer Platform
  2. Click the “Create new secret key” button and enter a project name to create a new API key.
  3. After creation, the system will display the API key. Be sure to copy and save it securely. The key is shown only once and cannot be viewed again.
API-Key

Install Claude Code

Refer to the Claude Code documentation for installation.

Configure MiniMax API

  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. Set MINIMAX_API_KEY to the API key obtained from the 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",
      "ANTHROPIC_SMALL_FAST_MODEL": "MiniMax-M2"
  }
}
  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 MiniMax-M2 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

  1. Click “Models” in the left sidebar to open the model configuration page.
  2. Expand the “API Keys” section and configure the API information:
  3. Paste the API key obtained from the MiniMax Developer Platform into the OpenAI API Key field.
cursor-model
  1. Click the “Verify” button, and click the “Enable OpenAI API Key” button in the pop-up window to complete verification.
cursor-verify
  1. In the Models section, click the “Add Custom Model” button, enter the model name “MiniMax-M2”, then click the “Add” button.
  2. Enable the newly added “MiniMax-M2” model.
  3. Select the “MiniMax-M2” model in the chat panel and start using “MiniMax-M2” for development.

Use MiniMax-M2 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.

Configure MiniMax API

  1. Click Use your own API key to open Cline’s configuration page.
  2. Under API Provider, select OpenAI Compatible to connect to the MiniMax API via the OpenAI-compatible standard.
  3. In Base URL, enter “https://api.minimax.io/v1” to set the MiniMax service endpoint.
  4. In OpenAI Compatible API Key, enter the API key from the MiniMax Developer Platform.
  5. In Model ID, enter “MiniMax-M2” to specify the model.
  6. Click Let’s go!, then 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” for development.

Use MiniMax-M2 in Grok CLI

Install Grok CLI

  1. Use npm to install the Grok CLI globally:
npm install -g @vibe-kit/grok-cli

Configure MiniMax API

  1. Set the base URL and API key using environment variables. Use the API key obtained from the MiniMax Developer Platform as the value for MINIMAX_API_KEY.
export GROK_BASE_URL="https://api.minimax.io/v1"  
export GROK_API_KEY="<MINIMAX_API_KEY>"
  1. Start the Grok CLI with a specified model: MiniMax-M2
grok --model MiniMax-M2

Use MiniMax-M2 in Codex CLI

To facilitate integrating models with the Codex CLI, it is recommended to use the codex-MiniMax-M2 model. While models can interact with files using tools like Bash, this approach is not considered optimal for Agent workflows. For better Agent-based practices, we suggest using platforms such as Claude Code or Cursor.

Install codex

npm i -g @openai/codex

Configure MiniMax API

  1. Add the following configuration to the .codex/config.toml file:
[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.m2]
model = "codex-MiniMax-M2"
model_provider = "minimax"
  1. Set the API key using environment variables in the current terminal session for security reasons. Use the API key obtained from the MiniMax Developer Platform as the value for MINIMAX_API_KEY.
export MINIMAX_API_KEY="<MINIMAX_API_KEY>"
  1. Start the Codex CLI with the specified profile.
codex --profile m2

Use MiniMax-M2 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

  1. Use following command to edit the configuration file located at ~/.factory/config.json. Set MINIMAX_API_KEY to the API key obtained from the MiniMax Developer Platform.
Tips: config ~/.factory/config.json, NOT ~/.factory/settings.json
cat ~/.factory/config.json
{
    "custom_models": [
        {
            "model_display_name": "MiniMax-M2",
            "model": "MiniMax-M2",
            "base_url": "https://api.minimax.io/anthropic",
            "api_key": "<MINIMAX_API_KEY>",
            "provider": "anthropic",
            "max_tokens": 131072
        }
    ]
}
  1. Navigate to your project and start interactive session
cd /path/to/your/project
droid
  1. Enter /model, select the “MiniMax-M2” model and use it in Droid.