Last verified: July 18, 2026. MiniMax M3 can accept text, images, and videos through MiniMax’s OpenAI-compatible Chat Completions and Anthropic-compatible Messages interfaces. It analyzes the supplied media and returns text. It does not generate a new image or video through these routes; media creation uses separate image-generation and video-generation APIs.
What this API does—and what it does not do
Use M3 multimodal input to describe a scene, extract visible text, compare screenshots, inspect a chart, summarize a clip, identify changes across frames, or answer a question grounded in supplied media. A response is model-generated analysis, not a forensic finding. Small text, rapid cuts, occlusion, missing visual context, and sparse frame sampling can cause omissions or mistakes.
MiniMax documents text, image, and video input for M3 through these interfaces, but does not list audio as a supported input type. Do not assume that a video soundtrack will be transcribed or analyzed. If speech or other audio matters to the task, process it through a documented audio workflow and evaluate that result separately.
| Goal | Correct MiniMax route | Result |
|---|---|---|
| Ask what an image or video contains | M3 through Chat Completions or Messages | Text analysis |
| Create an image | Image-generation API | Generated image |
| Create or animate a video | Video-generation API | Generated video task and output |
| Upload a large video for M3 analysis | Files API, then M3 with an mm_file:// reference | File ID followed by text analysis |
For the model’s broader context and reasoning behavior, use our MiniMax M3 guide. For the complete service map, use the MiniMax API overview.
Choose a protocol and media transport
| Interface | Image block | Video block | Base URL |
|---|---|---|---|
| Anthropic-compatible Messages | type: "image" with a source | type: "video" with a source | https://api.minimax.io/anthropic |
| OpenAI-compatible Chat Completions | type: "image_url" | type: "video_url" | https://api.minimax.io/v1 |
The official Anthropic-compatible guide documents M3 text, image, video, thinking, and tool blocks. The official OpenAI-compatible guide documents the parallel image_url and video_url content parts. Choose the family your application already handles well; do not combine block shapes from both in one request.
- Public or signed URL: avoids base64 expansion and is practical for a server-readable object. The URL must remain reachable long enough for MiniMax to fetch it.
- Base64: keeps bytes inside the JSON body, but increases request size and memory use. It remains subject to the request-body limit.
- Files API reference: use for a video that exceeds the direct 50 MB video limit but does not exceed the documented Files limit. Upload with purpose
video_understanding, then passmm_file://{file_id}.
Documented formats and limits
| Input | Formats | Limit |
|---|---|---|
| Image by URL or base64 | JPEG, PNG, GIF, WEBP | 10 MB per image |
| Video by URL or base64 | MP4, AVI, MOV, MKV | 50 MB per video |
| JSON request body | Text plus encoded media and request fields | 64 MB |
| Video uploaded through Files API | MP4, AVI, MOV, MKV | 512 MB per video |
| Uploaded video retention | Purpose video_understanding | Retained for up to 7 days |
The 64 MB request-body cap is separate from the media-file cap. Base64 is larger than the original binary, so a file below 50 MB can still push the JSON request over 64 MB. For MOV URLs, MiniMax’s schema specifies the object-store content type video/quicktime; for base64 MOV input it specifies video/mov. Validate the real file signature and MIME type rather than trusting an extension supplied by a user.
The official upload reference is the authority for video_understanding, the returned file_id, the supported video formats, and retention. “Up to 7 days” is not an archival promise. Keep your original in storage you control and delete unnecessary platform files when the applicable API and policy allow it.
Node.js: analyze an image URL with Messages
Install the Anthropic SDK with npm install @anthropic-ai/sdk. This plain JavaScript example keeps the MiniMax key and image URL in process-scoped variables. The key belongs on a trusted server, not in browser JavaScript.
import Anthropic from "@anthropic-ai/sdk";
const apiKey = process.env.MINIMAX_API_KEY;
const imageUrl = process.env.MEDIA_IMAGE_URL;
if (!apiKey || !imageUrl) {
throw new Error("Set MINIMAX_API_KEY and MEDIA_IMAGE_URL");
}
const client = new Anthropic({
apiKey,
baseURL: "https://api.minimax.io/anthropic",
});
const response = await client.messages.create({
model: "MiniMax-M3",
max_tokens: 800,
messages: [
{
role: "user",
content: [
{
type: "text",
text: [
"Describe only what is visibly supported.",
"Transcribe readable text exactly.",
"List uncertain details under a separate heading.",
].join(" "),
},
{
type: "image",
source: {
type: "url",
url: imageUrl,
detail: "default",
},
},
],
},
],
});
const answer = response.content
.filter((block) => block.type === "text")
.map((block) => block.text)
.join("\n");
if (!answer) throw new Error("No text block returned");
console.log(answer);
console.log({ responseId: response.id, usage: response.usage });
MiniMax documents M3 thinking as off by default in the Anthropic-compatible interface. If you explicitly enable adaptive thinking, handle thinking blocks separately and do not expose them as answer text. The OpenAI-compatible Chat Completions interface has a different default: M3 thinking is on when its thinking field is omitted.
Node.js: upload and analyze a larger video
This example uses Node’s built-in fetch, FormData, and openAsBlob. Confirm those APIs exist in your installed Node runtime. The code does not set a multipart Content-Type header manually; FormData must add its boundary.
import Anthropic from "@anthropic-ai/sdk";
import { openAsBlob } from "node:fs";
import { basename } from "node:path";
const apiKey = process.env.MINIMAX_API_KEY;
const videoPath = process.env.MEDIA_VIDEO_PATH;
if (!apiKey || !videoPath) {
throw new Error("Set MINIMAX_API_KEY and MEDIA_VIDEO_PATH");
}
const videoBlob = await openAsBlob(videoPath, { type: "video/mp4" });
const form = new FormData();
form.set("purpose", "video_understanding");
form.set("file", videoBlob, basename(videoPath));
const uploadResponse = await fetch(
"https://api.minimax.io/v1/files/upload",
{
method: "POST",
headers: { Authorization: `Bearer ${apiKey}` },
body: form,
},
);
const upload = await uploadResponse.json();
if (
!uploadResponse.ok ||
upload.base_resp?.status_code !== 0 ||
!upload.file?.file_id
) {
const code = upload.base_resp?.status_code ?? "missing";
const message = upload.base_resp?.status_msg ?? "No status message";
throw new Error(
`Upload failed (HTTP ${uploadResponse.status}, MiniMax ${code}): ${message}`
);
}
const uploadedFileId = upload.file.file_id;
if (
typeof uploadedFileId === "number" &&
!Number.isSafeInteger(uploadedFileId)
) {
throw new Error("file_id requires a lossless int64 JSON parser");
}
const client = new Anthropic({
apiKey,
baseURL: "https://api.minimax.io/anthropic",
});
const result = await client.messages.create({
model: "MiniMax-M3",
max_tokens: 1200,
messages: [
{
role: "user",
content: [
{
type: "text",
text: "Summarize the sequence by timestamp. Separate observation from inference.",
},
{
type: "video",
source: {
type: "url",
url: `mm_file://${uploadedFileId}`,
detail: "default",
fps: 1,
},
},
],
},
],
});
const text = result.content
.filter((block) => block.type === "text")
.map((block) => block.text)
.join("\n");
if (!text) throw new Error("No text block returned");
console.log(text);
Set the blob MIME type to the file you actually validated. Do not label AVI, MOV, or MKV bytes as MP4. The mm_file:// value is an API reference, not a public download URL. MiniMax’s schema accepts it inside a video source after a Files upload.
Python: send a base64 image with Chat Completions
Install the OpenAI package with python -m pip install openai. This example permits only the four documented image MIME types and disables M3 thinking so message.content contains the direct answer.
import base64
import mimetypes
import os
from pathlib import Path
from openai import OpenAI
api_key = os.environ.get("MINIMAX_API_KEY")
image_path = Path(os.environ.get("MEDIA_IMAGE_PATH", ""))
if not api_key or not image_path.is_file():
raise RuntimeError("Set MINIMAX_API_KEY and a valid MEDIA_IMAGE_PATH")
media_type, _ = mimetypes.guess_type(image_path.name)
allowed = {"image/jpeg", "image/png", "image/gif", "image/webp"}
if media_type not in allowed:
raise ValueError(f"Unsupported image type: {media_type}")
encoded = base64.b64encode(image_path.read_bytes()).decode("ascii")
data_url = f"data:{media_type};base64,{encoded}"
client = OpenAI(
api_key=api_key,
base_url="https://api.minimax.io/v1",
)
response = client.chat.completions.create(
model="MiniMax-M3",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Extract the table as Markdown. Mark unreadable cells."},
{
"type": "image_url",
"image_url": {"url": data_url, "detail": "high"},
},
],
}
],
max_completion_tokens=1200,
extra_body={"thinking": {"type": "disabled"}},
)
answer = response.choices[0].message.content
if not answer:
raise RuntimeError("No answer returned")
print(answer)
print(response.usage)
mimetypes.guess_type uses the filename; it is not a security validator. In an upload service, inspect magic bytes, reject polyglot or malformed files, cap dimensions and size before encoding, and process the file outside a public web root.
Control visual detail, frames, and token use
detailacceptslow,default, orhigh. Higher detail can help small visual elements but can increase token use. Measure response usage rather than treating a rough heuristic as a bill.fpsfor video defaults to 1 and accepts 0.2 through 5. A higher value samples more frames and can detect faster changes, with higher token use and slower processing. A lower value can miss brief events.max_long_side_pixelconstrains the longest side used for an image or sampled video frame. Downscaling can reduce cost but make small labels unreadable.
For a dependable evaluation, keep the media, prompt, detail, fps, pixel cap, and output limit fixed. Score timestamp accuracy, visible-text transcription, object recall, unsupported inferences, and format compliance. Compare settings on the same files rather than relying on a single attractive example.
Prompt patterns that make review easier
- Define the evidence boundary: “Use only visible evidence from the supplied media.”
- Request structure: ask for observations, timestamps or regions, uncertainties, and a short conclusion in separate fields.
- Make absence explicit: ask the model to state when text, an event, or an object is not visible.
- Avoid identity guesses: do not ask for sensitive traits or a real-person identity from appearance.
- Verify high-impact findings: require a human to inspect the original frame or image before action.
Security and failure handling
- Keep API keys server-side, use separate development and production credentials, and rotate exposed keys.
- Allow only HTTPS source URLs under your control or a restricted allowlist. Block loopback, link-local, private-network, and metadata-service addresses to reduce server-side request forgery risk.
- Remove embedded metadata when it is unnecessary, minimize personal data, and obtain consent for faces, screens, documents, and recordings.
- Set upload, request, and response timeouts. Treat a successful HTTP status with a malformed or empty payload as failure.
- Log the response ID, model, media hash, settings, usage, and redacted error—not the key or sensitive media URL.
- Retry only retryable failures with backoff and jitter. Do not upload the same large file repeatedly without checking whether the first upload succeeded.
Use the MiniMax API error and retry guide for status-aware handling. Check the MiniMax pricing guide before increasing detail, frame rate, or output length. Media understanding can consume substantially more input tokens than a short text prompt.
Pre-publication test checklist
- One JPEG, PNG, GIF, and WEBP case within the documented image limit.
- One MP4 plus each additional video format your application accepts.
- A URL that expires too early, redirects, returns HTML, or has the wrong content type.
- A direct video near 50 MB and a JSON body near 64 MB, without crossing production limits accidentally.
- A Files upload near the application’s own conservative ceiling, followed by an
mm_file://analysis request. - A fast-cut clip tested at two frame-sampling values.
- An image containing small text tested at two detail values.
- An interrupted request, rate limit, invalid key, unsupported format, empty text response, and retention-expiry scenario.
FAQ
Can M3 generate images or video through Chat Completions?
No. These M3 routes accept media for understanding and return text. Use MiniMax’s generation endpoints when the desired output is an image or video.
Can I send a 100 MB video as base64?
No. The documented direct video limit is 50 MB and the request-body limit is 64 MB. Upload a supported video through Files with purpose video_understanding, then reference its file ID, provided it stays within the 512 MB Files limit.
Does the Files API keep an uploaded analysis video permanently?
No. MiniMax documents retention of up to seven days for videos uploaded with video_understanding. Maintain your own authorized source copy and design for the reference to expire.
Which interface should I choose?
Choose Anthropic-compatible Messages if your application already processes Anthropic content blocks. Choose OpenAI-compatible Chat Completions if it already uses OpenAI-style message parts. Review our Anthropic-compatible guide and OpenAI-compatible guide before migration.
Implementation conclusion: validate the media, choose one protocol, respect both file and body limits, use video_understanding plus mm_file:// for larger videos, keep secrets server-side, and verify every high-impact answer against the original asset.
