Skip to content

Use MiniMax M3 With OpenCode on Windows or WSL

Add MiniMax M3 to OpenCode with the current OpenAI-compatible provider format, exact model ID, API key setup, and troubleshooting steps.

MGMCSA Guru Team July 31, 2026 2 min read
OpenCode configured to use MiniMax M3

OpenCode can call MiniMax through its OpenAI-compatible API. The important details are the current model ID, MiniMax-M3, and OpenCode’s current custom-provider format.

Install OpenCode and create a key

Follow the OpenCode Windows and WSL installation guide, then create an API key in the MiniMax Developer Platform.

In WSL, export the key in the terminal that will launch OpenCode:

export MINIMAX_API_KEY="YOUR_MINIMAX_API_KEY"

PowerShell uses this form for the current session:

$env:MINIMAX_API_KEY = "YOUR_MINIMAX_API_KEY"

Configure the provider

Open your opencode.json file and merge in this provider. Do not overwrite unrelated providers or permissions already in the file.

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "minimax": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "MiniMax",
      "options": {
        "baseURL": "https://api.minimax.io/v1",
        "apiKey": "{env:MINIMAX_API_KEY}"
      },
      "models": {
        "MiniMax-M3": {
          "name": "MiniMax M3"
        }
      }
    }
  },
  "model": "minimax/MiniMax-M3"
}

MiniMax M3 supports up to a 1-million-token context window and accepts native multimodal input. Availability and the usable context limit can depend on the API service and account.

Start OpenCode

Run OpenCode inside a project:

cd /path/to/project
opencode

The provider prefix in minimax/MiniMax-M3 must match the minimax key under provider. If you prefer to select the model interactively, start OpenCode and use /models.

Check the API directly

If OpenCode reports that it cannot find the model, ask MiniMax’s model endpoint what your key can access:

curl https://api.minimax.io/v1/models \
  -H "Authorization: Bearer $MINIMAX_API_KEY"

Look for MiniMax-M3 in the response. An authentication error means the key was not exported in the shell that launched OpenCode or belongs to a different MiniMax service region.

MiniMax and OpenCode check

  • Install a current OpenCode release
  • Create and export a MiniMax API key
  • Use https://api.minimax.io/v1 as the base URL
  • Enter MiniMax-M3 with exact capitalization
  • Start OpenCode and confirm the selected model

Older M2 models remain available, but M3 is the current choice for a new setup. Keeping the exact model ID in one provider block also makes future upgrades easy to review.

For Claude Code, use the direct MiniMax M3 setup.

Frequently asked questions

Which MiniMax model should I use in OpenCode?

Use MiniMax-M3 for a new setup. It is MiniMax's current coding and agent model.

What is MiniMax's OpenAI-compatible base URL?

The international API base URL is https://api.minimax.io/v1.

Why does OpenCode say model not found?

Check the exact capitalization of MiniMax-M3 and query MiniMax's /v1/models endpoint if needed.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.