Skip to Content
Video ModelsHailuo 02

Hailuo 02

Overview

Hailuo 2 is a high-quality video generation model that supports both text-to-video and image-to-video modes. This model offers two versions: Hailuo 02 and Hailuo 02 1080p.

Test API KEY: key_00000000000000000000000000000000

Endpoints

1. Create Task

Request

POST https://api.pixwith.ai/api/task/create

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Api-Key{API_KEY}Yes

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe input prompt (e.g., “A cat walking in the garden”)
image_urlsarrayConditional[“https://cdn.pixwith.ai/xxx.jpg ”]. Provide 1 image.
model_idstringYes2-3(Hailuo 02), 2-16(Hailuo 02 1080p)
optionsobjectYesConfiguration options for the task
options.prompt_optimizationbooleanYesIf true, all prompt words will be automatically translated into English.
options.resolutionstringRequiredResolution of the output. For model_id 2-3(Hailuo 02 with image): '512p',768p', For model_id 2-3 (Hailuo 02 without image): 768p(only). For model_id 2-16(Hailuo 02 1080p): '1080p'
options.durationintRequiredDuration in seconds. For model_id 2-3(Hailuo 02): 6 or 10. For model_id 2-16(Hailuo 02 1080p): 6

Example Request - Hailuo 02 (Text-to-Video)

{ "prompt": "A cat walking in the garden", "model_id": "2-3", "options": { "prompt_optimization": true, "resolution": "768p", "duration": 6 } }

Example Request - Hailuo 02 (Image-to-Video)

{ "prompt": "A cat walking in the garden", "image_urls": [ "https://cdn.pixwith.ai/images/cf0ddb5ad6a0f0c85ab4d1dceb9fd89c_0.jpeg" ], "model_id": "2-3", "options": { "prompt_optimization": true, "resolution": "512p", "duration": 6 } }

Example Request - Hailuo 02 1080p

{ "prompt": "A cat walking in the garden", "model_id": "2-16", "options": { "prompt_optimization": true, "resolution": "1080p", "duration": 6 } }

Response Parameters

ParameterTypeDescription
codeint1=success, 0=error
messagestringSuccess and failure messages
dataobject
data.task_idstring
data.estimated_timeintEstimated time in seconds

Response

{ "code": 1, "message": "success", "data": { "task_id": "d425ab4dc256f0ebaa84862b9cea8a3d", "estimated_time": 240 } }
Last updated on