DEV Community

Cover image for MiniMax M3 API: Complete Integration Guide
Mattias chaw
Mattias chaw

Posted on

MiniMax M3 API: Complete Integration Guide

MiniMax M3 API: Complete Integration Guide

MiniMax M3 is built for long-running agent work: coding, tool use, structured
execution, and multimodal inputs. Its hosted API accepts up to 1,000,000 tokens
across input and output, with text, image, and video input documented by
MiniMax.

The API model ID is case-sensitive: use MiniMax-M3.

Choose the protocol before the SDK

MiniMax supports both Anthropic- and OpenAI-compatible clients. The vendor
recommends its Anthropic-compatible endpoint when you need the full thinking
and interleaved-thinking behavior:

  • global Anthropic base URL: https://api.minimax.io/anthropic
  • global OpenAI base URL: https://api.minimax.io/v1
  • mainland China equivalents: api.minimax.cn

Pick one protocol and test your complete tool schema on it. Compatibility
reduces migration work, but it does not mean every provider-specific reasoning
field behaves identically.

Current pay-as-you-go price

The global Standard tier showed the following active rates on September 11,
2026, in USD per 1M tokens:

Total input tier New input Cached input Output
Up to 512K $0.30 $0.06 $1.20
Above 512K $0.60 $0.12 $2.40

A long-running agent loop connects tools, structured execution, and context

Priority service is 1.5 times those active rates. MiniMax labels the current
numbers as a permanent 50% discount, but a product label is not an immutable
contract. Save the rate-card date with any budget.

Prompt caching begins with eligible inputs of at least 512 tokens. Cached
tokens still count when MiniMax decides whether the request crosses the 512K
price boundary. A stable prefix can reduce cost; a timestamp or reordered file
near the start can turn the next request into a miss.

When Priority is worth testing

Priority service is useful only when lower queueing delay changes the value of
the result. An interactive coding assistant may justify it; a nightly index or
evaluation batch often will not. Run representative prompts on both tiers and
compare tail latency, not just the median. Include retries and failed requests
in the calculation. Paying 1.5 times the token rate for a job that still misses
its deadline is not a performance strategy.

Curl example

curl https://api.minimax.io/v1/chat/completions \
  -H "Authorization: Bearer $MINIMAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"MiniMax-M3","messages":[{"role":"user","content":"List the risky parts of this migration."}]}'
Enter fullscreen mode Exit fullscreen mode

Python example

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MINIMAX_API_KEY"],
    base_url="https://api.minimax.io/v1",
)

result = client.chat.completions.create(
    model="MiniMax-M3",
    messages=[{"role": "user", "content": "Return three test cases."}],
)
print(result.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

For AIWave, the client shape stays the same while the base URL and credential
change:

client = OpenAI(
    api_key=os.environ["AIWAVE_API_KEY"],
    base_url="https://aiwave.live/v1",
)
Enter fullscreen mode Exit fullscreen mode

The current AIWave catalog lists MiniMax-M3. Check the dated AIWave rate card
before a run; a gateway price includes its own route and commercial terms, so
it should not be presented as MiniMax's direct price.

Long-context discipline

A million-token ceiling is useful when the evidence genuinely belongs in one
request. It can also hide poor retrieval. Start by separating stable context
from changing context:

  • stable: architecture maps, interfaces, policy files, long reference sets;
  • changing: the current diff, user instruction, error log, and tool results.

Reusable cache layers feed a long-running agent without duplicating context

Keep the stable prefix deterministic if you expect caching. Reserve answer and
tool-call headroom instead of filling the window. MiniMax's public general API
documentation does not give one independent maximum-output number for every
case, so test the output length your application requires rather than copying a
benchmark setting into production.

Before launch, verify image/video payload handling, tool calls, streaming,
timeouts, cache-hit accounting, and the >512K tier with your own account. Log
the returned model ID and token usage for every request. If you route through a
gateway, reconcile that response against the gateway's per-request ledger.

Primary references

Top comments (0)