Use MiniMax M3 With Claude Code, Cursor, Codex, and OpenCode

Last verified: July 18, 2026. MiniMax publishes M3 setup instructions for Claude Code, Cursor, and Codex, plus an M3 entry in its “Other Tools” guide for OpenCode. The four tools do not use one universal configuration: Claude Code uses the Anthropic-compatible protocol, Cursor uses an OpenAI-compatible override, Codex uses the Responses wire format, and OpenCode offers a built-in provider flow.

Independent-site and verification notice: MiniMax-AI.chat is an independent website. It is not affiliated with or endorsed by MiniMax, Anthropic, Anysphere, OpenAI, or OpenCode. We checked the values and file formats against MiniMax’s official tool pages and reviewed the configuration syntax. We did not authenticate with a paid key or allow an agent to modify a repository. Menu labels and configuration fields can differ by tool version and operating system; compare each step with the interface you have installed.

Start with the right MiniMax key

This guide follows MiniMax’s Token Plan tool documentation and therefore uses a Subscription Key, commonly shown with an sk-cp- prefix. MiniMax documents that this key is used for Token Plan subscriptions and purchased Credits. It is separate from a pay-as-you-go API key and the two are not interchangeable. A Subscription Key can exist before usable resources are assigned, so possession of a key alone does not prove that a plan seat or Credits are available.

Read the official Token Plan overview before configuration. Use our MiniMax Token Plan guide for the account and quota workflow, and check MiniMax pricing before routing repository-scale work. If you intentionally use pay-as-you-go, follow the API account and billing instructions for that key rather than labeling it as a Token Plan setup.

Protocol and setting map

ToolProtocol or wire formatInternational base URLModel value
Claude CodeAnthropic-compatiblehttps://api.minimax.io/anthropicMiniMax-M3[1m] in MiniMax’s settings example; verify as MiniMax-M3 in the TUI
CursorOpenAI-compatiblehttps://api.minimax.io/v1MiniMax-M3
CodexOpenAI Responseshttps://api.minimax.io/v1MiniMax-M3
OpenCodeBuilt-in MiniMax Token Plan provider flowProvider-managed in the documented flowSelect MiniMax M3 from the available model list

Do not put global OPENAI_BASE_URL, OPENAI_API_KEY, ANTHROPIC_BASE_URL, or ANTHROPIC_AUTH_TOKEN exports in a shared shell profile just to configure one tool. They can silently redirect unrelated applications. The examples below use each tool’s own settings or credential flow. If you use a secret manager, inject the key only into the process that needs it.

Claude Code: Anthropic-compatible M3

The official MiniMax Claude Code guide uses ~/.claude/settings.json. Before relying on that file, check whether ANTHROPIC_AUTH_TOKEN or ANTHROPIC_BASE_URL already exists in the launching shell; MiniMax says shell environment values take priority over the settings file. Remove a conflicting global export from the shell profile or launch Claude Code from a clean, dedicated environment. Do not erase variables required by another project.

Merge the following env object into an existing settings file instead of overwriting unrelated Claude Code preferences. Replace the placeholder locally. The one-million-token compact threshold and [1m] model value are part of MiniMax’s documented M3 recipe.

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.minimax.io/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "<MINIMAX_SUBSCRIPTION_KEY>",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
    "ANTHROPIC_MODEL": "MiniMax-M3[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M3[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M3[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M3[1m]"
  }
}

Restrict the settings file to your user account because this documented form stores the key as text. In an organization, prefer an approved secret-injection method that preserves the same variable names for the Claude Code process without committing the value. Never add ~/.claude/settings.json to a repository.

  1. Open a disposable repository or a clean worktree and run claude.
  2. Review the “Trust This Folder” prompt before granting file access.
  3. Run /status and verify the MiniMax Anthropic base URL.
  4. Run /model and verify MiniMax M3 rather than an Anthropic-hosted model.
  5. Use /config to review Thinking mode. MiniMax documents extended thinking as enabled by default in Claude Code, with a keyboard toggle that can vary by operating system.

The Anthropic protocol behavior is covered separately in our MiniMax Anthropic-compatible API guide. Web search is not granted merely by changing the model endpoint; MiniMax documents a separate MCP setup for that capability.

Cursor: OpenAI-compatible override

The official MiniMax Cursor guide says custom models require Cursor Pro or a higher plan. In Cursor’s Models settings, enable Override OpenAI Base URL, enter https://api.minimax.io/v1, place the MiniMax Subscription Key in the OpenAI API Key field, complete Cursor’s verification action, add the custom model MiniMax-M3, enable it, and select it in the chat or agent panel.

MiniMax’s page warns that Cursor’s override is global across API keys configured in Cursor rather than isolated per model. That means a MiniMax base URL can disrupt Cursor-native OpenAI or Anthropic choices. Record the original setting before changing it, test MiniMax in a separate Cursor profile if your build supports profiles, and turn the override off before returning to another provider. Avoid exporting generic OpenAI variables in the shell because the UI already provides the intended configuration point.

Cursor verification

  • The selected model label is exactly MiniMax-M3.
  • A small, read-only question succeeds before Agent mode is allowed to edit files.
  • Switching the override off restores the other providers you use.
  • The Subscription Key is absent from project settings, screenshots, terminal output, and source control.

See our OpenAI-compatible API guide for Chat Completions behavior. Cursor’s agent can add its own tool layer and context selection, so an IDE result is not a direct API benchmark.

Codex: MiniMax through the Responses wire format

The official MiniMax Codex guide configures a named provider in the user-level ~/.codex/config.toml and uses wire_api = "responses", not Chat Completions. MiniMax’s example places a direct token in experimental_bearer_token. The official Codex configuration reference labels that direct-token field discouraged and directs custom providers to env_key. Use the safer provider configuration below:

model = "MiniMax-M3"
model_provider = "minimax"
model_context_window = 1000000

[model_providers.minimax]
name = "MiniMax"
base_url = "https://api.minimax.io/v1"
env_key = "MINIMAX_API_KEY"
wire_api = "responses"

Provider definitions must stay in the user-level file. Codex ignores model_provider and model_providers in project-local .codex/config.toml files. Supply the Subscription Key through the named MINIMAX_API_KEY environment variable only for the Codex process. Do not add it to a shared shell profile or write it into TOML.

# In a dedicated shell; input is hidden.
read -s MINIMAX_API_KEY
export MINIMAX_API_KEY
codex
unset MINIMAX_API_KEY

Restart Codex after editing the file. MiniMax also documents an optional custom model catalog so Codex can display M3 capabilities, image input, and reasoning choices. In that catalog, none disables M3 thinking and a non-none effort enables adaptive thinking; MiniMax says the label does not tune a series of reasoning depths. Start with the minimal provider configuration, verify a request, then add the catalog only if your Codex build recognizes the documented field.

  • Verify model_provider matches the [model_providers.minimax] table name.
  • Keep /v1 in the base URL and responses as the wire API.
  • Use /model where available to confirm M3 selection and reasoning mode.
  • Test in a repository with no secrets and inspect the diff before accepting changes.

Our MiniMax Responses API guide explains the underlying request family. Do not copy the Codex TOML into an OpenAI SDK integration; it is a Codex client configuration.

OpenCode: use the built-in MiniMax provider flow

MiniMax’s official Other Tools guide contains a dedicated OpenCode section and says its documented build has built-in MiniMax M3 support, with no configuration file required. It instructs users to run opencode auth login, select MiniMax Token Plan (minimax.io), enter the Subscription Key, and launch opencode.

opencode auth login
# Select: MiniMax Token Plan (minimax.io)
# Paste the Subscription Key only into the protected credential prompt.

opencode

The official OpenCode provider documentation also lists MiniMax, but describes the interactive TUI command /connect and then /models. These are interface and build differences, not evidence that one universal command works everywhere. If opencode auth login is absent, use the provider flow shown by your installed OpenCode help and official provider page. Select the Token Plan entry when that is the resource you intend to consume.

Do not publish a hand-built opencode.json as the primary method while the official MiniMax recipe says the built-in provider needs no config file. If your build lacks the named provider, upgrade through OpenCode’s documented channel or use its officially supported custom-provider mechanism with deliberate protocol settings; do not guess package names, field names, or model aliases.

Safe first-run workflow for every coding agent

  1. Use a disposable branch or clean worktree. Confirm git status before the agent starts.
  2. Remove sensitive files. Keep production credentials, customer exports, signing keys, and private environment files outside the test workspace.
  3. Begin read-only. Ask for a repository map and a proposed patch. Do not grant shell or write approval until the model identifies the correct files.
  4. Limit commands. Review each destructive, networked, package-install, migration, deployment, or publishing action.
  5. Require verification. Ask the agent to run the smallest relevant formatter, type check, and test, then inspect the actual diff yourself.
  6. Measure usage. Record tool, model, task, duration, failures, and Token Plan consumption so one runaway session is visible.

Troubleshooting by symptom

SymptomLikely check
401 or authentication failureConfirm the key is a usable Subscription Key with an assigned seat or Credits, and that no higher-priority environment variable supplies another key
404 or provider errorCheck the exact protocol URL: Anthropic path for Claude Code; /v1 for Cursor and Codex
Wrong model appearsCheck MiniMax-M3[1m] in the Claude settings recipe versus MiniMax-M3 in the other tool fields
Cursor’s built-in providers failDisable its global OpenAI base-URL override before using another provider
Codex sends the wrong request familyConfirm wire_api = "responses"
OpenCode lacks the named Token Plan optionCompare the installed help and OpenCode provider docs; update through the official channel rather than inventing a provider config
Quota or resource errorInspect Token Plan seat assignment, Credits access, usage bar, and account region

Capture the tool version, operating system, selected model, protocol URL, redacted error, and a minimal reproduction. Never include the Subscription Key in a screenshot or support message. Use our MiniMax API errors guide when the failure comes from the MiniMax endpoint.

Which tool should you choose?

ChooseWhen this is the useful fitKey caveat
Claude CodeYou prefer a terminal agent and Anthropic-style messagesEnvironment precedence and workspace trust need careful review
CursorYou want an IDE-native chat and agent workflowThe documented base-URL override can affect other configured providers
CodexYou use Codex and need a named Responses-compatible MiniMax providerKeep the provider in user config and inject the key through env_key
OpenCodeYou want an open-source terminal agent with a built-in provider pickerAuthentication commands and labels differ across builds

The model is only one layer. Each tool chooses context, wraps prompts, grants tools, applies compaction, and displays reasoning differently. Compare them on the same repository and acceptance test rather than interpreting one agent run as a pure MiniMax M3 benchmark.

FAQ

Can I reuse my pay-as-you-go key as the Token Plan Subscription Key?

No. MiniMax documents them as separate and not interchangeable. Obtain the Subscription Key from the Token Plan area for this workflow and verify that it has a plan seat or Credits.

Why does Claude Code use MiniMax-M3[1m] while other tools use MiniMax-M3?

That bracketed value is present in MiniMax’s Claude Code settings example alongside the one-million-token compact window. Its verification section expects the active model to display as MiniMax M3. Keep each tool’s documented value rather than normalizing every configuration by hand.

Should I set OpenAI or Anthropic variables in my shell profile?

Not for a single-tool setup. Global provider variables can redirect unrelated applications and can override tool settings. Prefer tool-scoped configuration or process-scoped secret injection.

Is OpenCode configuration file editing required?

MiniMax’s documented OpenCode flow says built-in MiniMax M3 support requires no config file. Use its named provider login. Only use a custom configuration when the installed OpenCode documentation requires it for a provider absent from the picker.


Configuration conclusion: use a Token Plan Subscription Key, match each tool to its documented protocol, scope secrets to that tool, verify the active model before granting write access, and keep a clean rollback path for both settings and code changes.