MiniMax API
Use MiniMax text, image understanding, and video generation with APIPool.
Use an Official Group API key with the base URL https://app.apipool.dev/v1. Check the MiniMax model catalog for available models.
Models and pricing
| Model ID | Input per million tokens | Cached input per million tokens | Output per million tokens |
|---|---|---|---|
minimax-m2.1 | US$0.2295 | US$0.2295 | US$0.918 |
minimax-m2.5 | US$0.255 | US$0.255 | US$1.02 |
minimax-m2.7 | US$0.255 | US$0.051 | US$1.02 |
minimax-m3 | US$0.255 | US$0.051 | US$1.02 |
Model IDs are case-sensitive. Check the model page for current prices. Output usage includes reasoning. Read cache hits from usage.prompt_tokens_details.cached_tokens. M2.1 and M2.5 use the standard input rate for cached input. Check charges in Usage.
Text and streaming
curl https://app.apipool.dev/v1/chat/completions \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"minimax-m2.5","messages":[{"role":"user","content":"Explain an API in one sentence"}],"max_tokens":1024,"stream":true,"stream_options":{"include_usage":true}}'For non-streaming, set stream: false and read choices[0].message.content. For streaming, assemble choices[].delta.content through data: [DONE] and keep the final usage. Some models report cumulative counts in multiple events. Use the final count.
max_tokens covers reasoning and the answer. A small limit can leave room only for reasoning. Set reasoning_split: true to receive reasoning in reasoning_content.
Function tools
tools supports type: "function" only. Your client executes returned tool_calls and adds the complete assistant message, including any reasoning_content, to history. Append a role: "tool" message with the matching tool_call_id and continue.
{
"model": "minimax-m3",
"messages": [{ "role": "user", "content": "Check the weather in Shanghai." }],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Look up a city forecast.",
"parameters": {
"type": "object",
"properties": { "city": { "type": "string" } },
"required": ["city"]
}
}
}
],
"max_tokens": 1024,
"stream": false
}Availability and troubleshooting
- Use
POST /v1/chat/completionsandn=1for chat. - M3 accepts HTTPS image URLs in message content, for example
{"type":"image_url","image_url":{"url":"https://example.com/image.png"}}. Use up to eight images and 128 KiB of JSON per request. Video, file input, and Hailuo or H3 video tasks are unavailable through chat. service_tier, built-in search, explicit cache writes, and unlisted parameters are unavailable.- HTTP 400. Check the model ID, field names, message format, and supported capabilities.
- HTTP 402. Check your wallet balance.
- HTTP 503 or an unavailable model. Check the catalog and keep the request ID for support. Avoid immediate bulk retries.
- After a disconnect or an uncertain charge, check usage before trying again.
Video generation
Submit an asynchronous task to POST /v1/videos/generations and use the same key with GET /v1/tasks/{id}. See asynchronous video tasks for statuses and downloads. Check the model catalog for availability.
Official Group prices are in US dollars per requested second. Small differences in actual playback length do not increase the charge.
| Model ID | Resolution and price per second | Duration and inputs |
|---|---|---|
MiniMax-H3 | 768P US$0.06069, 2K US$0.097155 | Integer 4–15 seconds. Default 5 seconds at 2K. |
MiniMax-H3-Max | 480P US$0.040035, 768P US$0.06069, 1080P US$0.136 | Integer 5–15 seconds. Default 5 seconds at 768P. |
MiniMax-Hailuo-02 | 512P US$0.01105, 768P US$0.0425, 1080P US$0.085 | 5 or 10 seconds. 1080P uses 5 seconds only and 512P requires a first frame. Default 5 seconds at 768P. |
MiniMax-Hailuo-2.3 | 768P US$0.05185, 1080P US$0.0765 | 6 or 10 seconds. 1080P uses 6 seconds only. Default 6 seconds at 768P. |
MiniMax-Hailuo-2.3-Fast | 768P US$0.02635, 1080P US$0.04505 | First frame required. 6 or 10 seconds. 1080P uses 6 seconds only. Default 6 seconds at 768P. |
For example, four seconds of H3 at 768P costs US$0.24276. Model IDs are case-sensitive. Each task returns one video.
curl https://app.apipool.dev/v1/videos/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"MiniMax-H3","prompt":"A ginger cat walking across a lawn with a fixed camera","duration":4,"resolution":"768P"}'Save the returned id and poll every five seconds until completed or failed.
curl "https://app.apipool.dev/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $APIPOOL_API_KEY"Read data after completion and save each video URL before expires_at. Use the model page to submit, check, and play videos.
Video parameters and limits
- Standard generation requires
prompt. H3 accepts up to 7,000 characters and Hailuo up to 2,000. - Set integer seconds in
durationand a listed tier inresolution. first_frame_imagetakes an HTTPS image URL. Only H3, H3 Max, and Hailuo-02 acceptlast_frame_image. Provide up to one image per frame.- H3 accepts up to nine references in
image_urls. The first five are included and references 6–9 are billed per image. H3 Max accepts up to two. Choose references or first and last frames.image_with_rolesacceptsfirst_frame,last_frame, andreference_imagewithin the same limits. - H3 accepts
21:9,16:9,4:3,1:1,3:4,9:16, andadaptive. With reference images, include up to three HTTPSaudio_urls. watermarkis optional and boolean. Omit it at H3 Max 1080P.- Hailuo accepts optional booleans
prompt_optimizerandfast_pretreatment. - H3 with 6–9 references accepts 768P or 2K and integer 4–15 seconds. Billing combines requested seconds and additional images. See the model page for rates. Use JPEG, PNG, or WebP up to 20 MiB each and 256–5,760 pixels per side.
video_urls, extra references for H3 Max, andMiniMax-H3-Context-IRare unavailable. Omit client-supplied source durations and costs. - Invalid parameters return HTTP 400. If submission is uncertain, check the original task ID. Querying a completed task again is free.
Regenerate H3 768P as 2K
MiniMax-H3-Regeneration uses the content and requested duration of a completed MiniMax-H3 768P task to create a new 2K video. Check catalog availability.
Use an APIPool source task ID under the same Official Group key. The source must be a completed H3 768P task with up to five images and no reference video.
curl https://app.apipool.dev/v1/videos/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"MiniMax-H3-Regeneration","source_task_id":"YOUR_COMPLETED_SOURCE_TASK_ID"}'Save the new task id and query it through completion. Omit prompt, duration, resolution, and references. Regeneration uses the original settings.
The Official Group rate is US$0.036465 per requested source second. Regenerating a four-second source costs US$0.14586. Each new submission creates a billable task. Queries are free.
HTTP 400 indicates an invalid or unverifiable source. When submission is uncertain, query the new task before retrying.