MiniMax H3 Video (workflow_id)
MiniMax H3 Video (workflow_id)
Section titled “MiniMax H3 Video (workflow_id)”MiniMax H3 uses the OpenAI-compatible asynchronous video API: submit a task → poll its status → download the video. Each request selects a workflow with workflow_id; the workflow decides which reference media are allowed and which sizes are supported.
POST https://api.4allapi.com/v1/videosAuthorization: Bearer YOUR_API_KEYContent-Type: application/json (multipart/form-data when uploading local files)Use the model name minimax-h3 (as shown in the console model marketplace). MiniMax H3 supports the OpenAI protocol only, not Gemini predictLongRunning.
Choosing a workflow
Section titled “Choosing a workflow”workflow_id | Reference media | Size |
|---|---|---|
text-to-video | No reference media; text only | Up to 1080P |
fl2v | 1–2 images; with two, they are the first and last frame in order; no video or audio | Up to 1080P |
multi-reference | Optional; up to 9 images, up to 3 videos and 3 audios | Up to 1080P |
cf-fl2v | Same as fl2v | Must be 2K or 4K |
cf-multi-reference | Same as multi-reference | Must be 2K or 4K |
Quick choice: text only → text-to-video; 1–2 images as first (and last) frame → fl2v; several images, reference videos or music → multi-reference. For 2K/4K output use the matching cf- workflow.
Requests that break the workflow rules (e.g. images with text-to-video, no image for fl2v, too many items, a cf- workflow below 2K) are rejected with 400 before submission and are not charged.
Request parameters
Section titled “Request parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | yes | minimax-h3 |
prompt | string | yes | Video description |
workflow_id | string | yes | See the table above |
seconds | integer | no | 4–15 seconds, default 10 |
resolution | string | no | 480p, 768p, 1080p; 2k, 4k only with cf- workflows |
aspect_ratio | string | no | 16:9 (default), 9:16, 1:1, 2:3, 3:2, 3:4, 4:3, 21:9 |
images | string[] | per workflow | Public image URLs; in fl2v the 1st is the first frame and the 2nd the last frame |
reference_videos | string[] | no | Public video URLs, up to 3 (multi-reference only) |
reference_audios | string[] | no | Public audio URLs, up to 3 (multi-reference only) |
prompt_enhance | boolean | no | Prompt enhancement, on by default |
resolution and aspect_ratio are mapped to the upstream’s standard canvas sizes, e.g. 768P 16:9 = 1376x768, 1080P 16:9 = 1920x1088, 1080P 9:16 = 1088x1920. 2K/4K are submitted as 2K/4K plus the aspect ratio.
Media limits: images JPG/PNG/WEBP/HEIC/HEIF, ≤ 30 MB each; videos MP4/MOV, ≤ 50 MB and 2–15 s each; audio WAV/MP3, ≤ 15 MB and 2–15 s each; total video and total audio length ≤ 15 s each. JSON requests must use public http(s) URLs (no Base64 / data URLs); upload local files with multipart.
Example: text-to-video
Section titled “Example: text-to-video”curl https://api.4allapi.com/v1/videos \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax-h3", "prompt": "一位身穿红色连衣裙的舞者在明亮舞台上自然起舞,镜头平稳推进,电影级光影", "workflow_id": "text-to-video", "seconds": 10, "resolution": "1080p", "aspect_ratio": "16:9" }'Example: first/last frame (fl2v)
Section titled “Example: first/last frame (fl2v)”curl https://api.4allapi.com/v1/videos \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax-h3", "prompt": "从首帧平滑过渡到尾帧,镜头运动自然稳定", "workflow_id": "fl2v", "seconds": 10, "resolution": "768p", "aspect_ratio": "9:16", "images": [ "https://cdn.example.com/first-frame.png", "https://cdn.example.com/last-frame.png" ] }'With a single image, it is used as the first frame.
Example: multi-reference
Section titled “Example: multi-reference”curl https://api.4allapi.com/v1/videos \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax-h3", "prompt": "将参考人物、动作和音乐融合成一段自然舞蹈视频", "workflow_id": "multi-reference", "seconds": 8, "resolution": "1080p", "aspect_ratio": "16:9", "images": ["https://cdn.example.com/person.png", "https://cdn.example.com/outfit.png"], "reference_videos": ["https://cdn.example.com/dance.mp4"], "reference_audios": ["https://cdn.example.com/music.mp3"] }'Example: 4K first/last frame (cf-fl2v)
Section titled “Example: 4K first/last frame (cf-fl2v)”curl https://api.4allapi.com/v1/videos \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax-h3", "prompt": "从首帧平滑过渡到尾帧,镜头运动自然稳定", "workflow_id": "cf-fl2v", "seconds": 10, "resolution": "4k", "aspect_ratio": "16:9", "images": ["https://cdn.example.com/first-frame.png", "https://cdn.example.com/last-frame.png"] }'Uploading local files (multipart)
Section titled “Uploading local files (multipart)”Repeat image[] for images, video[] for videos and audio[] for audio; other parameters are plain form fields. Files are stored on our media host before being sent upstream.
curl https://api.4allapi.com/v1/videos \ -H "Authorization: Bearer $API_KEY" \ -F "model=minimax-h3" \ -F "prompt=从首帧平滑过渡到尾帧" \ -F "workflow_id=fl2v" \ -F "seconds=10" \ -F "resolution=768p" \ -F "aspect_ratio=16:9" \ -F "image[]=@first.png;type=image/png" \ -F "image[]=@last.png;type=image/png"Full Python example
Section titled “Full Python example”import timeimport requests
BASE_URL = "https://api.4allapi.com"HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
body = { "model": "minimax-h3", "prompt": "从首帧平滑过渡到尾帧,镜头运动自然稳定", "workflow_id": "fl2v", "seconds": 10, "resolution": "1080p", "aspect_ratio": "16:9", "images": [ "https://cdn.example.com/first-frame.png", "https://cdn.example.com/last-frame.png", ],}
task = requests.post(f"{BASE_URL}/v1/videos", headers=HEADERS, json=body).json()task_id = task["id"]
while task.get("status") not in ("completed", "failed"): time.sleep(5) task = requests.get(f"{BASE_URL}/v1/videos/{task_id}", headers=HEADERS).json() print(task.get("status"), task.get("progress"))
if task["status"] == "completed": video = requests.get(f"{BASE_URL}/v1/videos/{task_id}/content", headers=HEADERS) video.raise_for_status() open("output.mp4", "wb").write(video.content)Query and download
Section titled “Query and download”# Status: queued / in_progress / completed / failedcurl https://api.4allapi.com/v1/videos/<TASK_ID> -H "Authorization: Bearer $API_KEY"
# Download the video (same API key)curl -L https://api.4allapi.com/v1/videos/<TASK_ID>/content \ -H "Authorization: Bearer $API_KEY" -o output.mp4Common errors
Section titled “Common errors”| Message | Cause |
|---|---|
workflow text-to-video is text-to-video only and accepts no reference media | Reference media sent with text-to-video |
workflow fl2v needs 1-2 images; got 0 | fl2v / cf-fl2v without images or with more than 2 |
workflow cf-fl2v requires size 2K or 4K | cf- workflow with a resolution other than 2k/4k |
2K/4K requires a cf- workflow | 2k/4k with a non-cf- workflow |
seconds must be between 4 and 15 | Duration outside 4–15 seconds |
unsupported video aspect ratio | Aspect ratio not in the supported list |
workflow xxx is not configured for minimax-h3 | That workflow is not enabled for your group |