MiniMax family
MiniMax’s text models, including MiniMax M3, M2.7 and M2.7 HighSpeed. They are called through the OpenAI-compatible API and also support the Anthropic-native API, so they work in Claude Code. For MiniMax’s video models, see Hailuo (MiniMax).
Common tasks
Models
For the full model list and live prices, see the model page . The model ID prefix is minimax/ and can be omitted; the official name MiniMax-M3 returns 404.
minimax/minimax-m3About 1.1M context; supports image inputminimax/minimax-m2.7200K context; text onlyminimax/minimax-m2.7-highspeed200K context; text onlyThese models are served by MiniMax (minimax) and support Chat Completions, Responses and the Anthropic-native API.
Examples
Python
import os
import re
from openai import OpenAI
client = OpenAI(base_url="https://api.ofox.io/v1", api_key=os.environ["OFOX_API_KEY"])
resp = client.chat.completions.create(
model="minimax/minimax-m3",
messages=[{"role": "user", "content": "Explain idempotency in one sentence."}],
)
content = resp.choices[0].message.content
answer = re.sub(r"<think>.*?</think>\s*", "", content, flags=re.S)
print(answer)Thinking content
MiniMax models think by default. On the OpenAI-compatible API, message.content begins with thinking content wrapped in <think>…</think>, followed by the answer; streaming responses likewise return it in delta.content. The example above strips it with a regular expression.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.ofox.io/v1", api_key=os.environ["OFOX_API_KEY"])
resp = client.chat.completions.create(
model="minimax/minimax-m3",
messages=[{"role": "user", "content": "A number plus 3 times itself, minus 12, equals 36. What is the number? Answer with the number only."}],
extra_body={"thinking": {"type": "disabled"}},
)
print(resp.choices[0].message.content)- MiniMax M3 accepts only
adaptiveanddisabledforthinking.type;enabledreturns 400. - Thinking tokens count toward
max_tokens. If the limit is too low, the answer may stop inside the thinking content, withfinish_reasonset tolength. - Thinking tokens are billed at the output rate; the count is in
usage.completion_tokens_details.reasoning_tokens.
Use in Claude Code
MiniMax models support the Anthropic-native API at https://api.ofox.io/anthropic. On this API, thinking content is returned as separate thinking blocks and the answer is in text blocks, so you don’t need to strip think tags yourself.
https://api.ofox.io/anthropicminimax/minimax-m3import os
import anthropic
client = anthropic.Anthropic(base_url="https://api.ofox.io/anthropic", api_key=os.environ["OFOX_API_KEY"])
resp = client.messages.create(
model="minimax/minimax-m2.7",
max_tokens=4096,
messages=[{"role": "user", "content": "A number plus 3 times itself, minus 12, equals 36. What is the number?"}],
)
for block in resp.content:
print(block.type, ":", getattr(block, "thinking", None) or block.text)- MiniMax M2.7 and M2.7 HighSpeed always return
thinkingblocks. - MiniMax M3 returns
thinkingblocks when you pass"thinking": {"type": "adaptive"}or{"type": "enabled", "budget_tokens": 2000}, and onlytextblocks when you pass{"type": "disabled"}.
For full Claude Code setup steps, see Claude Code setup.
Image input
Only MiniMax M3 supports image input, using the standard image_url content block; see Vision for the syntax. MiniMax M2.7 and M2.7 HighSpeed are text-only; use M3 when you need image understanding.
Other features
- Tool calling: uses the standard
toolsparameter and returnstool_calls. - Caching: repeated request prefixes are cached automatically; the cached amount is in
usage.prompt_tokens_details.cached_tokens. In our tests, with an identical prefix of about 5,600 tokens, the second request had over 5,000 cached tokens. - Structured output: in our tests, passing a
json_schemainresponse_formatstill produced plain text. If you need JSON, describe the fields in the prompt and parse the output yourself.
Common errors
For other general errors, see Error Handling.
Official docs
FAQ
How do I write a MiniMax model ID?
The standard format is minimax/minimax-m3; you can also omit the prefix and write minimax-m3. The official name MiniMax-M3 returns 404.
Why does the MiniMax answer start with think tags?
MiniMax thinks by default, and on the OpenAI-compatible API the thinking content is wrapped in think tags at the start of the answer. You can strip it with a regular expression; with MiniMax M3 you can also set the thinking type to disabled, or use the Anthropic API to get separate thinking blocks.
Can I turn off thinking on MiniMax M2.7?
No. MiniMax M2.7 and M2.7 HighSpeed still think when disabled is passed. Use MiniMax M3 if you need to turn thinking off.
Can I use MiniMax in Claude Code?
Yes. Set ANTHROPIC_BASE_URL to https://api.ofox.io/anthropic and use minimax/minimax-m3 or minimax/minimax-m2.7 as the model.
Can MiniMax understand images?
Only MiniMax M3 supports image input. MiniMax M2.7 and M2.7 HighSpeed are text-only.