generate_video
Generate a video from a text description and/or first/last-frame image using MiniMax. The default model is MiniMax-H3, MiniMax’s next-generation flagship served by the new V2 API. V1 models (T2V-01, T2V-01-Director, MiniMax-Hailuo-2.3, MiniMax-Hailuo-02) remain selectable for cheaper drafts. Video generation typically takes 1–5 minutes.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | ✓* | — | Text description of the video (max 2,000 chars). Supports camera commands (see below). Required for MiniMax-H3. |
model | string | — | MiniMax-H3 | Model: MiniMax-H3 (V2 API), MiniMax-Hailuo-2.3, MiniMax-Hailuo-02, T2V-01-Director, T2V-01 (V1 API) |
first_frame_image | string | ✓* | — | First frame as a base64 data URI or public URL |
last_frame_image | string | — | — | MiniMax-H3 only: last frame image (base64 data URI or public URL). Combines with first_frame_image for first+last frame video. Mutually exclusive with reference inputs. |
reference_image_urls | string[] | — | — | MiniMax-H3 only: reference image URLs (max 9) for reference-to-video. Mutually exclusive with first/last frame images. |
reference_video_urls | string[] | — | — | MiniMax-H3 only: reference video URLs (max 3) for reference-to-video. Mutually exclusive with first/last frame images. |
reference_audio_urls | string[] | — | — | MiniMax-H3 only: reference audio URLs (max 3) for reference-to-video. Mutually exclusive with first/last frame images. |
duration | integer | — | 5 (H3) / 6 (V1) | Duration in seconds. MiniMax-H3: 4–15 (default 5). V1 models: 6 or 10 (default 6). |
resolution | string | — | 768P (H3) | Output resolution. V1 models: 720P, 768P, 1080P. MiniMax-H3: 768P (default) or 2K. |
ratio | string | — | — | MiniMax-H3 only: adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, 9:16. Required (non-adaptive) for text-to-video; always adaptive for image-to-video. |
prompt_optimizer | boolean | — | true | Auto-optimize the prompt for better results. V1 models only. |
* At least one of prompt or first_frame_image is required. MiniMax-H3 additionally requires a text prompt.
Camera Commands
Section titled “Camera Commands”When using MiniMax-H3 or a Hailuo model (MiniMax-Hailuo-2.3, MiniMax-Hailuo-02), you can embed camera direction commands in the prompt:
| Command | Effect |
|---|---|
[Pan left] | Camera pans left |
[Pan right] | Camera pans right |
[Zoom in] | Camera zooms in |
[Zoom out] | Camera zooms out |
[Tracking shot] | Camera follows the subject |
[Aerial shot] | Bird’s-eye overhead view |
[Arc shot] | Camera arcs around the subject |
Two-Step Workflow
Section titled “Two-Step Workflow”Step 1: generate_video(prompt="...") → returns task_idStep 2: query_generation_task(task_id="...") → returns status + download URL when completePoll every 30–60 seconds until the status is Success. The default api: 'auto' on query_generation_task handles both V1 and V2 (MiniMax-H3) tasks automatically.
Usage Examples
Section titled “Usage Examples”Text-to-video (MiniMax-H3, default):
“A golden retriever playing fetch on a beach at sunset, slow motion.” (add
ratio: "16:9"— a non-adaptive ratio is required for text-to-video)
With camera commands and resolution:
“Generate a video of a cat jumping off a diving board [Tracking shot], then splashing into the pool [Zoom in]. Use MiniMax-H3 at 2K, 5 seconds.”
Cheaper V1 draft:
“Generate a 10-second video of a cat jumping off a diving board [Tracking shot], then splashing into the pool [Zoom in]. Use MiniMax-Hailuo-2.3 at 1080P.”
Image-to-video:
“Create a video from this image: [attach image] — the person starts walking forward through a forest.”
Combined pipeline (image → video):
Step 1: generate_image(prompt="A futuristic car on a neon-lit highway, 16:9")Step 2: generate_video(prompt="The car starts driving forward through the city", first_frame_image="<base64 from step 1>")Step 3: query_generation_task(task_id="<from step 2>")Response
Section titled “Response”Returns a text part with the task_id, model, and API version used, and instructions to poll with query_generation_task.
Pricing
Section titled “Pricing”Video generation is billed to your MiniMax account balance (MINIMAX_API_KEY). The default MiniMax-H3 (V2 API) is billed per output second: $0.13/s at 2K and $0.08/s at 768P (e.g. 5 s @ 2K = $0.65, 5 s @ 768P = $0.40). The first 5 reference images are free, then $0.04 each; reference video is billed per input second at the output resolution rate; reference audio is free.
V1 models are billed per video and are cheaper for casual drafts — e.g. MiniMax-Hailuo-2.3 is $0.28 for a 768P, 6 s clip. Select a V1 model explicitly when you want V1 pricing.
See Model Pricing for the full breakdown of video, image, music, and TTS costs.
- MiniMax-H3 is the current default and highest-quality model (successor to Hailuo 2.3), served by the V2 API at
https://api.minimax.io. It is billed per second (Pay-as-You-Go). - V1 models (
T2V-01,T2V-01-Director,MiniMax-Hailuo-2.3,MiniMax-Hailuo-02) are billed per video and are cheaper for drafts — select them explicitly when you want V1 pricing. - Reference URLs must be publicly accessible URLs or base64 data URIs — the V2 API accepts public URLs and base64 only.
query_generation_taskpolls both API generations automatically withapi: 'auto'(default) — see query_generation_task.- Camera commands are supported on MiniMax-H3 and Hailuo models (
MiniMax-Hailuo-2.3,MiniMax-Hailuo-02). - The
MINIMAX_REQUEST_TIMEOUT_MSenv var controls how long the MCP client waits for the initial API call (not the full generation time).