generate_video
Generate a video from a text description and/or a first-frame image using MiniMax Hailuo models. 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). |
model | string | — | T2V-01 | Model: MiniMax-Hailuo-2.3, MiniMax-Hailuo-02, T2V-01-Director, T2V-01 |
first_frame_image | string | ✓* | — | Base64 data URI or public URL for the first frame of the video |
duration | integer | — | 6 | Duration in seconds: 6 or 10 |
resolution | string | — | — | Output resolution: 720P, 768P, 1080P |
prompt_optimizer | boolean | — | true | Auto-optimize the prompt for better results |
* At least one of prompt or first_frame_image is required.
Camera Commands (Hailuo models)
Section titled “Camera Commands (Hailuo models)”When using MiniMax-Hailuo-2.3 or 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.
Usage Examples
Section titled “Usage Examples”Text-to-video:
“A golden retriever playing fetch on a beach at sunset, slow motion.”
With camera commands and resolution:
“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 and model used, and instructions to poll with query_generation_task.
T2V-01andT2V-01-Directorare earlier generation models;MiniMax-Hailuo-2.3is the latest and highest quality.- Camera commands are only supported on 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).