> ## Documentation Index
> Fetch the complete documentation index at: https://platform.minimax.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# M3 for AI Coding Tools

> **MiniMax-M3** features strong **code understanding**, **multi-turn dialogue**, and **reasoning capabilities**. 

<Note>
  MiniMax Open Platform offers two billing options: Token Plan and Pay-As-You-Go. You can choose flexibly based on your usage requirements.<br />
  The billing model is determined by the API Key you use. Different types of keys will trigger different billing methods.
</Note>

## Use MiniMax-M3 in Claude Code (Recommended)

### Install Claude Code

Refer to the [Claude Code documentation](https://code.claude.com/docs/en/setup) for installation.

### Configure MiniMax API

<Warning>
  **Important: Clear Anthropic Environment Variables Before Configuration**

  Before configuring, ensure you clear the following Anthropic-related environment variables to avoid conflicts with MiniMax API:

  * `ANTHROPIC_AUTH_TOKEN`
  * `ANTHROPIC_BASE_URL`

  ```bash theme={null}
  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.
</Warning>

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](https://platform.minimax.io/user-center/payment/token-plan) (For users in China, visit [MiniMax Developer Platform](https://platform.minimaxi.com/user-center/payment/token-plan)).
* 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.

```json theme={null}
{
  "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"
  }
}
```

2. 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](https://filecdn.minimax.chat/public/ed3b7564-a187-4807-9ae8-218c50182103.PNG)

3. You can now start using Claude Code for development.

### 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:

```text theme={null}
/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`.

### Use M3 in Claude Code Extension for VS Code

<Steps>
  <Step title="Install Plugin">
    Install Claude Code Extension for VS Code

    <img src="https://filecdn.minimax.chat/public/6939e914-b090-4f4f-9c0b-1e394828c23c.jpg" width="80%" />
  </Step>

  <Step title="Open Settings">
    After installation, click **Settings**

    ![](https://filecdn.minimax.chat/public/d538a295-18e1-4381-ab35-3cfd2fbb7cfc.png)
  </Step>

  <Step title="Configure Model">
    Configure the model to `MiniMax-M3`

    * In Settings → `Claude Code: Selected Model`, enter `MiniMax-M3`

    ![](https://file.cdn.minimax.io/public/89bbece2-4a8a-4678-ab06-0499d9ae7f50.jpg)

    Or

    * Click `Edit in settings.json`, modify `claude-code.selectedModel` to `MiniMax-M3` in the configuration file.

    ```json theme={null}
    {
      "claudeCode.preferredLocation": "panel",
      "claudeCode.selectedModel": "MiniMax-M3",
      "claudeCode.environmentVariables": []
    }
    ```
  </Step>

  <Step title="Configure 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`

    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`

    ```json theme={null}
    "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-M3"
            },
            {
                "name": "ANTHROPIC_DEFAULT_SONNET_MODEL",
                "value": "MiniMax-M3"
            },
            {
                "name": "ANTHROPIC_DEFAULT_OPUS_MODEL",
                "value": "MiniMax-M3"
            },
            {
                "name": "ANTHROPIC_DEFAULT_HAIKU_MODEL",
                "value": "MiniMax-M3"
            },
            {
                "name": "CLAUDE_CODE_AUTO_COMPACT_WINDOW",
                "value": "512000"
            }
        ],
    ```
  </Step>
</Steps>

## Use MiniMax-M3 in OpenClaw

### Prerequisites

* A MiniMax [Subscription Key](https://platform.minimax.io/user-center/payment/token-plan) with Token Plan or Credits access
* A computer with terminal access (macOS, Linux, or Windows with WSL)

### Install and Configure OpenClaw

<Steps>
  <Step title="Run Installation Command">
    Run the installation command in your terminal:

    ```bash theme={null}
    curl -fsSL https://openclaw.ai/install.sh | bash
    ```

    You'll see this entry page:

    <img src="https://file.cdn.minimax.io/public/0fc6ba49-4324-4d69-ae58-56e4f5eac647.png" alt="Entry page" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} />
  </Step>

  <Step title="Start Setup">
    Select **"Yes"** .
  </Step>

  <Step title="Select QuickStart Mode">
    Select **"QuickStart"** to use the guided setup.
  </Step>

  <Step title="Select Model Provider">
    Select **"MiniMax"** as the model provider.
  </Step>

  <Step title="Select Auth Method">
    Select **"MiniMax Global — OAuth (minimax.io)"** as the authentication method.
  </Step>

  <Step title="Sign In to MiniMax">
    You'll be sent to a browser window to sign in to or sign up for your MiniMax API Platform account.
  </Step>

  <Step title="Authorize OpenClaw">
    Select **"Authorize"**, after which you can return to the terminal.

    <img src="https://mintcdn.com/minimax-cac98058/Z6t8NKWdGWkRU7_m/images/openclaw-authorize.png?fit=max&auto=format&n=Z6t8NKWdGWkRU7_m&q=85&s=8f6f82d5c7e0ed9288ff7c055542d43f" alt="Authorize" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} width="1280" height="800" data-path="images/openclaw-authorize.png" />
  </Step>

  <Step title="Confirm Model Selection">
    A model picker will appear with the available models already selected. Press **Enter** to continue.
  </Step>

  <Step title="Select a Messaging Channel">
    Back in the terminal, select a messaging channel to connect. OpenClaw supports a range of platforms including Telegram, WhatsApp, Discord, iMessage, and more.

    <img src="https://file.cdn.minimax.io/public/6307996b-250d-45be-b004-68b1d3ddd396.png" alt="Select channel" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} />
  </Step>

  <Step title="Confirm Installation">
    Follow the prompts for your chosen channel, then select **"Yes"** when asked to confirm.

    <img src="https://file.cdn.minimax.io/public/b1d04c91-ab5f-494a-a798-ce9484eb71f2.png" alt="Confirm" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} />
  </Step>

  <Step title="Select Skills">
    Select any additional skills you wish to install (press space to select, up and down arrows to navigate).

    <img src="https://file.cdn.minimax.io/public/560c2837-c62c-4685-acd9-26fc0e0648db.png" alt="Select skills" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} />
  </Step>

  <Step title="Configure API Keys">
    Configure additional API Keys for tools that OpenClaw can use (optional). Select **"Skip for now"** if you don't need additional tools.

    <img src="https://file.cdn.minimax.io/public/668de94c-6ab0-4e61-8a1b-7312a0c2357d.png" alt="Configure API Keys" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} />
  </Step>

  <Step title="Open Web UI">
    Select **"Open the Web UI"** to access the OpenClaw dashboard.

    <img src="https://file.cdn.minimax.io/public/2ae52543-decb-4269-8d4d-475577e3edfe.png" alt="Open Web UI" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} />
  </Step>
</Steps>

<Tip>
  When logged in to `minimax-portal` via OAuth, OpenClaw's `image` tool is automatically configured to use the VLM endpoint behind MiniMax's [Image Understanding MCP server](/token-plan/mcp-guide), giving your agent image understanding capabilities out of the box — no extra setup needed.

  For a full step-by-step walkthrough of connecting OpenClaw to Telegram (including bot creation and pairing), see the [OpenClaw Cookbook guide](/solutions/openclaw).
</Tip>

## Use MiniMax-M3 in Hermes Agent

[Hermes Agent](https://github.com/NousResearch/hermes-agent) is an open-source, self-improving AI agent built by [Nous Research](https://nousresearch.com). It features persistent cross-session memory, a built-in learning loop, 40+ integrated tools, and multi-platform access (CLI, Telegram, Discord, Slack, WhatsApp).

### Install Hermes Agent

Run the one-line installer in your terminal (macOS, Linux, or Windows with WSL2):

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
```

For more information, refer to the [Hermes Agent documentation](https://hermes-agent.nousresearch.com/docs/).

### Configure MiniMax Token Plan

Hermes Agent has built-in support for MiniMax. Run the model selector:

```bash theme={null}
hermes model
```

1. Select **"MiniMax (global endpoint)"** from the provider list.

<img src="https://mintcdn.com/minimax-cac98058/GOJmMenSBGK8R2VS/images/hermes-agent-provider-global.png?fit=max&auto=format&n=GOJmMenSBGK8R2VS&q=85&s=907f0d4bb6b2a77d1efc49518f75cb47" alt="Select MiniMax (global endpoint)" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} width="2004" height="1490" data-path="images/hermes-agent-provider-global.png" />

2. When prompted, enter your **Subscription Key** obtained from the [MiniMax Token Plan page](https://platform.minimax.io/user-center/payment/token-plan).

<img src="https://mintcdn.com/minimax-cac98058/GOJmMenSBGK8R2VS/images/hermes-agent-apikey-global.png?fit=max&auto=format&n=GOJmMenSBGK8R2VS&q=85&s=d6ae4ec68a00826fb5513a1ed2bd4111" alt="Enter MiniMax API Key" style={{borderRadius: '8px', marginTop: '12px', maxWidth: '100%'}} width="1232" height="230" data-path="images/hermes-agent-apikey-global.png" />

3. Select **MiniMax-M3** as the model.

## Use MiniMax-M3 in Cursor

### Install Cursor

1. Download and install Cursor from the [Cursor website](https://cursor.com/agents).
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](https://filecdn.minimax.chat/public/e4755804-3b87-43e3-b595-5c0806f72853.png)

### Configure MiniMax API

<Warning>
  **Important: Clear OpenAI Environment Variables Before Configuration**

  Before configuring, ensure you clear the following OpenAI-related environment variables to avoid conflicts with MiniMax API:

  * `OPENAI_API_KEY`
  * `OPENAI_BASE_URL`
</Warning>

<Warning>
  **Note: Custom models require a Cursor Pro subscription or above.**

  Without Cursor Pro, configuration will result in the following error:

  `The model MiniMax-M3 does not work with your current plan or api key`
</Warning>

<Warning>
  **Known issue: "Override OpenAI Base URL" is a global setting**

  Once enabled, the override applies to **all** API Keys you've configured in Cursor — including Anthropic / GPT keys for Cursor's built-in models. This is acknowledged by Cursor staff: when you set a base URL, all your API Keys see it ([forum thread](https://forum.cursor.com/t/anthropic-models-break-when-override-openai-baseurl-is-set/144899)).

  If your Cursor-native Claude / GPT models stop working after enabling Override, turn it off when you're not using MiniMax. Cursor currently does not support per-model base URLs ([open feature request](https://forum.cursor.com/t/custom-base-urls-for-each-custom-model/147219)).
</Warning>

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](https://platform.minimax.io/user-center/payment/token-plan) (For users in China, visit [MiniMax Developer Platform](https://platform.minimaxi.com/user-center/payment/token-plan)) into the OpenAI API Key field.
4. Click the button on the right side of the **"OpenAI API Key"** field.

![cursor-configuration](https://filecdn.minimax.chat/public/09b8444b-1dfd-4aaa-8b3a-7d2918971c6e.png)

5. Click the **"Enable OpenAI API Key"** button in the pop-up window to complete verification.

![cursor-verify](https://filecdn.minimax.chat/public/0b716077-5312-434b-939f-c952e5ed8778.png)

6. In the **Models** section, click the **"View All Models"** button, and then click the **"Add Custom Model"** button.

![](https://filecdn.minimax.chat/public/0c4bebfb-2859-482e-872b-11d6d361bc63.jpeg)

7. Enter the model name **"MiniMax-M3"**, then click the **"Add"** button.

<Note>
  Use the exact model name `MiniMax-M3` (capital M's, lowercase i, hyphen) — match the spelling shown in MiniMax docs.
</Note>

![](https://file.cdn.minimax.io/public/e7ab1c99-6442-4e48-8ed9-479b87b7bab7.png)

8. Enable the newly added **"MiniMax-M3"** model.
9. Select the **"MiniMax-M3"** model in the chat panel and start using "MiniMax-M3" for development.

<Note>
  **Cursor Tab autocomplete is not powered by your custom MiniMax key.** Tab is a Cursor Pro feature that always uses Cursor's own model. Custom models only work in Chat / Composer / Edit modes.
</Note>

## Use MiniMax-M3 in TRAE

### Install and Launch TRAE

<Steps>
  <Step title="Download and Install TRAE">
    Go to [TRAE's website](https://www.trae.ai/?utm_source=content\&utm_medium=doc_minimax\&utm_campaign=minimax) to install TRAE
  </Step>

  <Step title="Complete Initial Setup">
    Click TRAE's icon to launch it. The following screen appears at TRAE's first launch
  </Step>

  <Step title="Start Setup">
    Click the Get Started button, TRAE's setup begins

    For detailed installation steps, please refer to: [Trae Setup Guide](https://docs.trae.ai/ide/set-up-trae?_lang=en)
  </Step>
</Steps>

### Configure MiniMax API

<Warning>
  **Important: Clear OpenAI Environment Variables Before Configuration**

  Before configuring, ensure you clear the following OpenAI-related environment variables to avoid conflicts with MiniMax API:

  * `OPENAI_API_KEY`
  * `OPENAI_BASE_URL`
</Warning>

In TRAE, you can connect to MiniMax M3 model using API Keys obtained from the [MiniMax Developer Platform](https://platform.minimax.io/user-center/payment/token-plan) .

<Steps>
  <Step title="Open Settings">
    At the top right of the side chat box, click Settings icon > Models
  </Step>

  <Step title="Select Models Tab" />

  <Step title="Add Model">
    Click the + Add Model button. The Add Model pop-up appears

    <img src="https://file.cdn.minimax.io/public/752ab8be-95e4-4abd-a70d-7f792f82d1e0.png" width="60%" />

    Enter Configuration Details:

    * Provider: Select **MiniMax-Global**
    * Model: Select **MiniMax-M3**

    <Note>
      Use `MiniMax-M3` as the model ID.
    </Note>

    * API Key: Input your **[MiniMax API Key](https://platform.minimax.io/user-center/payment/token-plan)**
  </Step>

  <Step title="Complete Adding">
    Click the **Add Model** button
  </Step>
</Steps>

## Use MiniMax-M3 in OpenCode

### Install OpenCode

* Use `curl` to install the OpenCode

```bash theme={null}
curl -fsSL https://opencode.ai/install | bash
```

* Use `npm` to install the OpenCode

```bash theme={null}
npm i -g opencode-ai
```

For more information, please refer to the [OpenCode website](https://opencode.ai/)

### Configure MiniMax API

<Steps>
  <Step title="Run Authentication Command">
    ```bash theme={null}
    opencode auth login
    ```
  </Step>

  <Step title="Select Provider">
    When prompted to select a provider, search and select **MiniMax（minimax.io）**

    <img src="https://file.cdn.minimax.io/token-plan/openclaw/en-select-provider-tokenplan.jpg" width="60%" />
  </Step>

  <Step title="Enter API Key">
    When prompted, enter your **MiniMax API Key**

    <img src="https://file.cdn.minimax.io/public/ae100336-41ba-4f81-9dde-f6386b42b6ae.png" width="80%" />
  </Step>

  <Step title="Start Using">
    Return to the command line and enter `opencode` to start using **MiniMax-M3**
  </Step>
</Steps>

**Alternative Configuration Method:**

<Steps>
  <Step title="Edit Configuration File">
    Edit the OpenCode configuration file located at `~/.config/opencode/opencode.json`, and add the following configuration:

    <Warning>
      **Important: Clear Anthropic Environment Variables Before Configuration**

      Before configuring, ensure you clear the following Anthropic-related environment variables to avoid conflicts with MiniMax API:

      * `ANTHROPIC_AUTH_TOKEN`
      * `ANTHROPIC_BASE_URL`
    </Warning>

    ```json theme={null}
    {
      "$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-M3": {
              "name": "MiniMax-M3"
            }
          }
        }
      }
    }
    ```
  </Step>

  <Step title="Start OpenCode">
    Navigate to your project directory and start `opencode`

    ```bash theme={null}
    cd /path/to/your/project

    opencode
    ```
  </Step>

  <Step title="Select Model">
    Enter `/models`, select the "**MiniMax-M3**" model to start using it in OpenCode
  </Step>
</Steps>

## Use MiniMax-M3 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.

<img src="https://filecdn.minimax.chat/public/f515a531-ff92-4797-ad96-a4afcada914e.jpg" width="80%" />

### Configure MiniMax API

<Warning>
  **Important: Clear Anthropic Environment Variables Before Configuration**

  Before configuring, ensure you clear the following Anthropic-related environment variables to avoid conflicts with MiniMax API:

  * `ANTHROPIC_AUTH_TOKEN`
  * `ANTHROPIC_BASE_URL`
</Warning>

1. Click the **"Settings"** button to enter the configuration page.

<img src="https://filecdn.minimax.chat/public/827b88f5-8f56-441d-8c81-adb9be4eddc5.png" width="60%" />

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 obtained from [MiniMax Developer Platform](https://platform.minimax.io/user-center/payment/token-plan) (For users in China, visit [MiniMax Developer Platform](https://platform.minimaxi.com/user-center/payment/token-plan))

5. In **Model**, select **MiniMax-M3**.

6. Click **"Save"** and **"Done"** buttons in the top-right corner to save the configuration.

7. Start using **"MiniMax-M3"**.

## Use MiniMax-M3 in Grok CLI (Not Recommended)

### Install Grok CLI

1. Install Grok CLI globally using `npm`:

```bash theme={null}
npm install -g @vibe-kit/grok-cli
```

### Configure MiniMax API

<Warning>
  **Important: Clear OpenAI Environment Variables Before Configuration**

  Before configuring, ensure you clear the following OpenAI-related environment variables to avoid conflicts with MiniMax API:

  * `OPENAI_API_KEY`
  * `OPENAI_BASE_URL`
</Warning>

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](https://platform.minimax.io/user-center/payment/token-plan) (For users in China, visit [MiniMax Developer Platform](https://platform.minimaxi.com/user-center/payment/token-plan))

```bash theme={null}
export GROK_BASE_URL="https://api.minimax.io/v1"
export GROK_API_KEY="<MINIMAX_API_KEY>"
```

2. Start Grok CLI with the specified model "**MiniMax-M3**":

```bash theme={null}
grok --model MiniMax-M3
```

## Use MiniMax-M3 in Codex CLI (Not Recommended)

For convenience in integrating the model with Codex CLI, it is recommended to use the model name **codex-MiniMax-M3**. 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`:

```bash theme={null}
# Recommended to use version 0.57.0
npm i -g @openai/codex@0.57.0
```

### Configure MiniMax API

<Warning>
  **Important: Clear OpenAI Environment Variables Before Configuration**

  Before configuring, ensure you clear the following OpenAI-related environment variables to avoid conflicts with MiniMax API:

  * `OPENAI_API_KEY`
  * `OPENAI_BASE_URL`
</Warning>

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`

```toml theme={null}
[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.m3]
model = "codex-MiniMax-M3"
model_provider = "minimax"
```

2. 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](https://platform.minimax.io/user-center/payment/token-plan) (For users in China, visit [MiniMax Developer Platform](https://platform.minimaxi.com/user-center/payment/token-plan))

```
export MINIMAX_API_KEY="<MINIMAX_API_KEY>"
```

3. Start Codex CLI with the specified configuration file:

```bash theme={null}
codex --profile m3
```

## Use MiniMax-M3 in Droid

### Install Droid

For Mac/Linux Users：

```bash theme={null}
curl -fsSL https://app.factory.ai/cli | sh
```

For Windows Users:

```bash theme={null}
irm https://app.factory.ai/cli/windows | iex
```

For more information, please refer to the [Droid documentation](https://docs.factory.ai/cli/getting-started/quickstart).

### Configure MiniMax API

<Warning>
  **Important: Clear Anthropic Environment Variables Before Configuration**

  Before configuring, ensure you clear the following Anthropic-related environment variables to avoid conflicts with MiniMax API:

  * `ANTHROPIC_AUTH_TOKEN`
  * `ANTHROPIC_BASE_URL`
</Warning>

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](https://platform.minimax.io/user-center/payment/token-plan) (For users in China, visit [MiniMax Developer Platform](https://platform.minimaxi.com/user-center/payment/token-plan)).

<Note>
  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
</Note>

```json theme={null}
{
    "custom_models": [
        {
            "model_display_name": "MiniMax-M3",
            "model": "MiniMax-M3",
            "base_url": "https://api.minimax.io/anthropic",
            "api_key": "<MINIMAX_API_KEY>",
            "provider": "anthropic",
            "max_tokens": 64000
        }
    ]
}
```

2. Navigate to your project and start interactive session

```bash theme={null}
cd /path/to/your/project
droid
```

3. Enter `/model`, select the "**MiniMax-M3**" model and use it in Droid.

## Use MiniMax-M3 in Zed

### Install Zed

Follow the [Zed official documentation](https://zedhub.org/getting-started) to complete the Zed installation and configuration.

### Configure MiniMax API

<Steps>
  <Step title="Open the Agent Panel">
    Click the ✨ icon in the bottom right corner to open the Agent panel:

    <img src="https://filecdn.minimax.chat/public/f8abfdc5-214c-4631-8b00-3670ac4980d4.png" width="80%" />
  </Step>

  <Step title="Enter Settings">
    Click the three-dot icon in the top right corner to enter settings:

    <img src="https://filecdn.minimax.chat/public/4a69bc97-a88e-4df3-abbe-e613711b140e.png" width="80%" />
  </Step>

  <Step title="Add LLM Provider">
    Find the **LLM Provider** section, click **+Add Provider** and select **OpenAI** from the dropdown menu:

    <img src="https://filecdn.minimax.chat/public/5ac831b4-03fe-4d02-af78-e8af665b9527.png" width="80%" />
  </Step>

  <Step title="Fill in Configuration">
    Enter the configuration panel and fill in the following information:

    | Configuration     | Value                                                                                              |
    | ----------------- | -------------------------------------------------------------------------------------------------- |
    | **Provider Name** | Set as needed                                                                                      |
    | **API URL**       | **[https://api.minimax.io/v1](https://api.minimax.io/v1)**                                         |
    | **API Key**       | Your API Key from the platform. Refer to [Quick Start](/guides/quickstart-preparation) for details |
    | **Model Name**    | `MiniMax-M3`                                                                                       |

    Adjust other configurations according to your needs.

    Complete configuration reference:

    <img src="https://file.cdn.minimax.io/public/dcbba869-9617-4356-afdc-f7c71929b661.jpg" width="80%" />
  </Step>

  <Step title="Save Configuration">
    Click **Save Provider** to save. The LLM Provider now includes MiniMax. Click MiniMax, enter your **API Key** again, and press `Enter` to save.
  </Step>

  <Step title="Select Model and Start Using">
    Return to the Agent panel, click **Select a Model** in the bottom right corner and select the MiniMax-M3 model you just configured. You can now use MiniMax-M3 for AI-assisted development.
  </Step>
</Steps>

## Troubleshooting

### API Error

```bash theme={null}
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](https://platform.minimax.io/user-center/payment/token-plan) (For users in China, visit [MiniMax Developer Platform](https://platform.minimaxi.com/user-center/payment/token-plan))
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-M3`. For more details, see: [Using M3 in Claude Code for VS Code](/guides/text-ai-coding-tools#use-m3-in-claude-code-extension-for-vs-code)
5. Reached the [rate limit](/guides/rate-limits#3-rate-limits-for-our-api), please wait and try again later.

If the issue persists, feel free to contact us at: [**api@minimax.io**](mailto:api@minimax.io)
