Hailuo AI Video Generator
POST /api/v1/hailuo-ai-video-generator/submit
Required inputs
Required inputs depend on the selected mode. Check the mode rules below before submitting.
Edit the sample inputs for your own task before submitting.
# Set VIDMAGE_IDEMPOTENCY_KEY to a unique value for this task; preserve it for transport retries.
curl -X POST "https://vidmage.ai/api/v1/hailuo-ai-video-generator/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ${VIDMAGE_IDEMPOTENCY_KEY}" \
-H "Content-Type: application/json" \
-d '{"prompt":"Macro shot of morning dew rolling across a green leaf, shallow depth of field and gentle camera movement","duration":"6","enablePromptExpansion":true}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Parameters and input rules4 fields
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
prompt | string | No | Not specified | Text prompt describing the video to generate (max 2000 chars). Optional only in provider modes whose image input fully defines the generation. Maximum length: 2000 |
imageUrl | string | No | Not specified | Optional input image URL. When provided, the task runs in image-to-video mode. No additional field constraint listed. |
duration | string | No | "6" | Video duration in seconds. Values: "6", "10" · Default: "6" |
enablePromptExpansion | boolean | No | true | Automatically expand and refine the prompt before generation. Default: true |
Mode-specific fields & media limits
Text To Video rules
| Control | Mode-specific rule |
|---|---|
prompt | Required; minimum 1 characters; maximum 2000 characters |
duration | Values: "6", "10"; mode default: "6" |
enablePromptExpansion | Default: true |
Image To Video rules
| Control | Mode-specific rule |
|---|---|
prompt | Optional; minimum 0 characters; maximum 2000 characters |
duration | Values: "6", "10"; mode default: "6" |
imageUrl | Image input |
enablePromptExpansion | Default: true |
Retrieve the result
Save taskId from the accepted submission and send it to this endpoint:
POST /api/v1/hailuo-ai-video-generator/query
Use the same Bearer API key. On completion, read the videoUrl result field.
curl -X POST "https://vidmage.ai/api/v1/hailuo-ai-video-generator/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "taskId": "TASK_ID_FROM_SUBMIT" }'
# -> { "success": true, "data": { "status": "...", "videoUrl": "https://..." } }