Use MiniMax M3 in OpenCode: setup and pricing

Add BigModel.io as a provider in opencode.json to run MiniMax M3 (minimax-m3) in OpenCode. $0.30 input / $1.20 output per 1M tokens, with a config you can paste.

Model ID
minimax-m3
Input / 1M
$0.30
Output / 1M
$1.20
Context
—

Set up OpenCode with MiniMax M3

  1. Create an API key in the BigModel.io console and give it a spend limit; agents send long contexts.
  2. Put the block below in ~/.config/opencode/opencode.json and export BIGMODEL_API_KEY in your shell.
  3. Run opencode; /models lists minimax-m3 under BigModel.io.

~/.config/opencode/opencode.json

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

Add a limit block with the context window from the developer's documentation so OpenCode compacts history in time.

Check the key and model first

This request should return a short reply. If it fails, the tool will fail the same way.

curl https://bigmodel.io/v1/chat/completions \
  -H "Authorization: Bearer $BIGMODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"minimax-m3","messages":[{"role":"user","content":"ping"}]}'

401 means the key is wrong, 404 the model ID; fix 401 · fix 404

What it costs

MiniMax M3 costs $0.30 per 1M input tokens and $1.20 per 1M output tokens, $0.06 per 1M cached input tokens. A typical agent turn with 20K tokens in and 2K out costs about $0.0084; 100 turns about $0.840. MiniMax M3 pricing →

Other setups