Setup guide - Documented by MiniMax
Use MiniMax in OpenCode
MiniMax documents OpenCode setup through OpenCode's built-in 'MiniMax Token Plan (minimax.io)' provider via opencode auth login, with an optional opencode.json model entry, or via the mmx-cli wizard.
Last verified 4 steps2 official sources
Steps
- Step 1.
Option 1 (one-click setup wizard): run the wizard and select OpenCode. It installs the official npm package, verifies its version, and sets a MiniMax default model. Run
opencodewhen setup finishes.Terminalnpx -y mmx-cli@latest agent setup - Step 2.
Option 2 (manual): install OpenCode.
Terminalcurl -fsSL https://opencode.ai/install | bash # or: npm i -g opencode-ai - Step 3.
Authenticate: run
opencode auth login, search and pick MiniMax Token Plan (minimax.io) (the provider name in OpenCode), and enter your Subscription Key.Terminalopencode auth login - Step 4.
Run
opencodeand select MiniMax-M3.1-Flash-Preview from the model list. If your version does not list it, add the following to ~/.config/opencode/opencode.json and run it again.JSON{ "$schema": "https://opencode.ai/config.json", "provider": { "minimax-coding-plan": { "models": { "MiniMax-M3.1-Flash-Preview": { "name": "MiniMax-M3.1-Flash-Preview", "limit": { "context": 524288 } } } } } }
Caveats
- This path uses OpenCode's built-in MiniMax Token Plan provider (provider id minimax-coding-plan) with an M Plan Subscription Key; the base URL is handled by OpenCode, so none is configured manually.
- MiniMax-M3.1-Flash-Preview is available only through M Plan and MiniMax Code for now. A pay-as-you-go path in OpenCode is not documented on the MiniMax page.
- The 524288 context limit is MiniMax's recommended 512K client window; the model supports up to 1M.
More setup guides
Same tool, other providers
Related reading
- MiniMax H3: An Omni-Modal Video Model With Native Audio, 2K Output, and Open Weights ComingMiniMax H3 turns text, image, video and audio input into 2K video with native stereo sound at 0.80 CNY per second, with open weights promised to follow.
- MiniMax M2.5 for Developers: The Anthropic-Compatible Budget Frontier ModelMiniMax M2.5 hits 80.2% on SWE-bench Verified and plugs into the Anthropic SDK with two environment variables. Here is what you need to know before switching.
- OpenCode Hacked: What the Console Breach Means for Your API KeysOpenCode disclosed a breach of its Console that may have exposed provider keys. Who is affected, what to rotate today, and why hosted key gateways are the real risk.
- OpenCode 2: How to Upgrade From v1 Without Breaking Your SetupOpenCode 2 upgrade from v1: what the migration guide says breaks (plugins, server API, TUI config), what carries over, and a safe checklist before you switch.
- Run Your Coding Agent as an API: OpenCode Server on RailwayOpenCode server on Railway: run opencode serve in a container as a password-protected HTTP API with a persistent volume, reachable from any machine or webhook.
- Give Every Agent PR a Live Preview: Railway Environments for AI Pull RequestsRailway preview environments for agent pull requests: an isolated copy of your whole stack for every PR, so you verify agent changes by running them.
FAQ
How do I use MiniMax in OpenCode?
MiniMax documents OpenCode setup through OpenCode's built-in 'MiniMax Token Plan (minimax.io)' provider via opencode auth login, with an optional opencode.json model entry, or via the mmx-cli wizard.
Which MiniMax model ids work in OpenCode?
The official docs read for this guide list MiniMax-M3.1-Flash-Preview.
Is this an official MiniMax and OpenCode setup?
MiniMax documents this setup in its own docs. It was last checked against 2 official pages on October 17, 2026.
Sources
Last verified against 2 official pages.
- platform.minimax.iohttps://platform.minimax.io/docs/m-plan/opencode.md
- platform.minimax.iohttps://platform.minimax.io/docs/api-reference/text-openai-api.md
Newsletter
New models, set up the day they ship
One email per week. New model releases, the coding tools that support them and how to wire them up.