Use POST /videos to create a Hailuo video generation task. The examples include optional route and route_mode fields; remove them to use the default available route.
Text-to-video example:
curl -s https://api.getopenmodels.com/v1/videos \-H "Authorization: Bearer $OM_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "MiniMax/MiniMax-Hailuo-2.3","route": { "provider": "<provider-for-this-model>" },"route_mode": "balanced","prompt": "Generate a video of a carp leaping over the Dragon Gate.","prompt_optimizer": true,"fast_pretreatment": false,"duration": 6,"resolution": "1080P","aigc_watermark": false}'
Image-to-video example:
curl -s https://api.getopenmodels.com/v1/videos \-H "Authorization: Bearer $OM_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "MiniMax/MiniMax-Hailuo-2.3","route": { "provider": "<provider-for-this-model>" },"route_mode": "balanced","first_frame_image": "https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg","prompt": "Generate a video of a carp leaping over the Dragon Gate.","prompt_optimizer": true,"fast_pretreatment": false,"duration": 6,"resolution": "1080P","aigc_watermark": false}'
Use the returned ID to retrieve the task status and generated video result.
curl "https://api.getopenmodels.com/v1/videos/{id}" \-H "Content-Type: application/json" \-H "Authorization: Bearer $OM_API_KEY"
For the MiniMax Hailuo model, set generation options in the request body.
| Field | Type | Notes |
|---|---|---|
model | string | Model name. Use MiniMax/MiniMax-Hailuo-2.3. |
first_frame_image | string | Required for image-to-video. Use a public image URL or a base64 Data URL such as data:image/jpeg;base64,.... Supported formats: JPG, JPEG, PNG, WebP. File size must be under 20 MB, the short side must be over 300 px, and the aspect ratio must be between 2:5 and 5:2. |
prompt | string | Text description of the video. Required for text-to-video. Maximum length: 2000 characters. Supports camera-control instructions in square brackets. |
prompt_optimizer | boolean | Whether to optimize the prompt automatically. Default: true. Set false for more direct prompt control. |
fast_pretreatment | boolean | Whether to reduce prompt optimizer preprocessing time. Default: false. |
duration | integer | Video duration in seconds. Default: 6. 768P supports 6 or 10; 1080P supports 6. |
resolution | string | Video resolution. A 6-second video supports 768P or 1080P; a 10-second video supports 768P. Default: 768P. |
callback_url | string | Optional URL for task status callbacks. If omitted, poll GET https://api.getopenmodels.com/v1/videos/{id}. |
aigc_watermark | boolean | Whether to add an AI-generated-content watermark. Default: false. |