Integration guides · 2026-10-19
MiniMax M3.1 Flash API: first request, reasoning_effort, price
Call MiniMax M3.1 Flash on LLMTR through an OpenAI-compatible API: 1M context, image and video, reasoning_effort, tool calling and price.
Short answer: one OpenAI-compatible request
LLMTR is a gateway that gives access to language models from different providers through one OpenAI-compatible API. MiniMax M3.1 Flash is served here as minimax/minimax-m3.1-flash and is called on the /v1/chat/completions endpoint at https://llmtr.com/v1. The API key of an account you open on llmtr.com is all you need: change the base URL in the OpenAI SDK, put this id in the model field, and the request works.
The model is MiniMax's release for coding, tool-using agents and long-context work. The LLMTR catalog lists it with a 1,000,000-token context window; it returns at most 524,288 tokens per response and accepts text, image and video input. It costs $0.15 input, $0.015 cached input and $0.60 output per 1M tokens. The price is a single tier across the whole context window; there is no separate price for long prompts.
| Property | Value |
|---|---|
| Model id | minimax/minimax-m3.1-flash |
| Endpoint | /v1/chat/completions |
| Context window | 1,000,000 tokens |
| Maximum output per response | 524,288 tokens |
| Input / cached input / output (per 1M tokens) | $0.15 / $0.015 / $0.60 |
| Input types | text, image, video |
| reasoning_effort | low, medium, high, xhigh, max (default max) |
| JSON | json_object; a strict json_schema is not enforced |
| Tool calling | supported |
How do you use the MiniMax M3.1 Flash API?
Three steps are enough. First, open an account on llmtr.com, top up your balance under Dashboard > Billing and create a key under Dashboard > API Keys. Next, set the base URL of your OpenAI-compatible client to https://llmtr.com/v1. Finally, put minimax/minimax-m3.1-flash in the model field and send the request to the /v1/chat/completions endpoint. The Python example below sends a system message and a user message, chooses the medium reasoning depth, and prints the reasoning trace and the token usage next to the answer.
The answer arrives in choices[0].message.content and the reasoning trace arrives separately in the reasoning_content field, so you do not have to look for tags inside the content to separate them. The usage field gives input and output tokens and shows cached input in prompt_tokens_details.cached_tokens. For streaming, send stream: true; if you add include_usage: true inside stream_options, usage arrives in the last chunk. Treat a response whose finish_reason is length as incomplete and raise max_tokens.
OpenAI Python SDK example that sends a request to minimax/minimax-m3.1-flash through https://llmtr.com/v1/chat/completions at the medium reasoning depth and prints the answer, the reasoning trace and the usage field.
import os
from openai import OpenAI
client = OpenAI(base_url="https://llmtr.com/v1", api_key=os.environ["LLMTR_API_KEY"])
response = client.chat.completions.create(
model="minimax/minimax-m3.1-flash",
messages=[
{"role": "system", "content": "You are a senior software engineer."},
{"role": "user", "content": "Find the bug: def add(a, b): return a - b"},
],
reasoning_effort="medium",
max_tokens=8192,
)
choice = response.choices[0]
print(choice.finish_reason)
print(getattr(choice.message, "reasoning_content", None))
print(choice.message.content)
print(response.usage)
Reasoning depth: reasoning_effort
Reasoning cannot be turned off on MiniMax M3.1 Flash; you choose its depth with the reasoning_effort field, one of five levels: low, medium, high, xhigh and max. According to MiniMax's documentation, max applies when the field is omitted. The higher the level, the longer the model reasons and the more output tokens it produces; reasoning tokens are counted in completion_tokens and billed at the output price, $0.60 per 1M tokens.
The model adjusts its reasoning to the difficulty of the request: on a simple question no reasoning trace may come back at all, while on a multi-step task it grows. The level can also be given as a suffix on the model id, for example minimax/minimax-m3.1-flash:low. The values none and minimal, and the bodies reasoning: false, reasoning: { enabled: false } and thinking: { type: disabled }, return 400; for the least reasoning, send low. Because reasoning also counts toward the max_tokens budget, leave a few thousand tokens even on requests where you expect a short answer.
Image and video input
Send an image as an image_url part; both a base64 data URL and a remote https address are accepted. For video, use a video_url part as a base64 data URL. Audio input is not supported. Image and video tokens are counted in prompt_tokens and billed at the input price. MiniMax's documentation defines a detail field for images; the low value usually comes to a few hundred tokens for a single image.
The same endpoint and the same model id serve tasks such as explaining an error in a screenshot, extracting attributes from a product photo, or summarizing what happens in a short video. reasoning_effort works on requests with images or video as well; for descriptions and summaries low is often enough. When the image carries text, such as an invoice or a form, check the result against a few examples from your own data.
Tool calling and JSON output
The model supports tool and function calling. Define the functions in the tools field; when the model decides to call one, the response returns with finish_reason: tool_calls. Run the tool and send the result back in a role: tool message, and the model completes the answer. In multi-step loops, send the assistant message that holds the tool call back with its reasoning_content field; MiniMax recommends keeping the reasoning trace for the next turn.
Where you need JSON, put { type: json_object } in the response_format field; the response comes back as a valid JSON object. A strict json_schema is not enforced: the model does not hold to the schema while it generates, so validate the fields on your side. For a flow that needs schema validation, wrap the call in a small helper that repeats the request once when validation fails.
Cost and prompt cache
The bill has three items: uncached input at $0.15, cached input at $0.015 and output at $0.60, all per 1M tokens. Example: if 15,000 tokens of a 20,000-token prompt are read from the cache and the answer is 2,000 tokens long, the cost is (5,000 x $0.15 + 15,000 x $0.015 + 2,000 x $0.60) / 1M = $0.002175. The same request without a cache hit costs $0.0042.
The cache is a discount, not a guarantee. Putting a long, unchanging system prompt, the tool definitions or a document at the start of the messages improves the hit rate; leave the part that changes at the end. The number of tokens read from the cache appears in prompt_tokens_details.cached_tokens on every response, so you can follow the discount directly on your own requests. To cap spending, set a spending limit on your API key.
First API request with MiniMax M3.1 Flash
Create an LLMTR API key, set the client's base URL to https://llmtr.com/v1 and send a request to the minimax/minimax-m3.1-flash model.
- Key. Top up your balance on llmtr.com and create a key under Dashboard > API Keys.
- Base URL. Set the base URL to https://llmtr.com/v1 in your OpenAI-compatible client.
- Request. Put minimax/minimax-m3.1-flash in the model field, choose reasoning_effort and send it to the /v1/chat/completions endpoint.
Frequently asked questions
How much does MiniMax M3.1 Flash cost?
$0.15 input, $0.015 cached input and $0.60 output per 1M tokens. The same price applies across the whole context window.
Can reasoning be turned off on MiniMax M3.1 Flash?
No. You choose a level from low to max with reasoning_effort; for the least reasoning, send low. Requests that turn reasoning off return 400.
Can I send images and video to MiniMax M3.1 Flash?
Yes. Send an image in an image_url part as base64 or an https address, and a video in a video_url part as a base64 data URL.
Related posts
- MiniMax M3.1 Flash or M3? Price and feature differences
- 1M-context Flash models: MiniMax, DeepSeek, Qwen and GLM
- MiniMax M3.1 Flash Preview on the LLMTR API: free access, limits and first request
- MiniMax M3.1 Flash vs Haiku 5.5, GPT-6 Luna, Gemini 3.8 Flash
- Which MiniMax model? M3.1 Flash, M3, M2.7 and M2.5