Skip to Content
ModelsMiniMax

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.

Common model IDs (copy them exactly)
MiniMax M3minimax/minimax-m3About 1.1M context; supports image input
MiniMax M2.7minimax/minimax-m2.7200K context; text only
MiniMax M2.7 HighSpeedminimax/minimax-m2.7-highspeed200K context; text only

These models are served by MiniMax (minimax) and support Chat Completions, Responses and the Anthropic-native API.

Examples

minimax_basic.py
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

Key pointOn the OpenAI-compatible API, thinking content is wrapped in think tags at the start of the answer. Strip it before showing the answer to users, or use the Anthropic API to get separate thinking blocks.

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.

ModelTurning off thinking
MiniMax M3Pass "thinking": {"type": "disabled"}; thinking content no longer appears in the answer
MiniMax M2.7, M2.7 HighSpeedNot supported; the model still thinks when it is passed
minimax_no_thinking.py
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 adaptive and disabled for thinking.type; enabled returns 400.
  • Thinking tokens count toward max_tokens. If the limit is too low, the answer may stop inside the thinking content, with finish_reason set to length.
  • 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.

Claude Code settings
ANTHROPIC_BASE_URLhttps://api.ofox.io/anthropic
ANTHROPIC_AUTH_TOKENPaste your OfoxAI API key
ANTHROPIC_MODELminimax/minimax-m3
minimax_anthropic.py
import 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 thinking blocks.
  • MiniMax M3 returns thinking blocks when you pass "thinking": {"type": "adaptive"} or {"type": "enabled", "budget_tokens": 2000}, and only text blocks 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 tools parameter and returns tool_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_schema in response_format still produced plain text. If you need JSON, describe the fields in the prompt and parse the output yourself.

Common errors

HTTP · typeError messageCauseFix
400 bad_request_errorinvalid params, invalid thinking.type: "enabled" (allowed: adaptive, disabled) (2013)thinking.type: enabled was sent to MiniMax M3 on the OpenAI-compatible APIOmit thinking (thinking is on by default), or pass disabled
400 bad_request_errorinvalid params, model[MiniMax-M3] does not support max tokens > 524288 (2013)max_tokens exceeds the limitLower max_tokens
404 model_not_foundModel 'MiniMax-M3' not foundMiniMax’s official model name was usedUse minimax/minimax-m3
Answer starts with <think>—The OpenAI-compatible API returns thinking content in contentSee Thinking content

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.

Last updated on