Hailuo 2
Overview
Hailuo 2 is a high-quality video generation model that supports both text-to-video and image-to-video modes.
Test API KEY: key_00000000000000000000000000000000Endpoints
1. Create Task
Request
POST https://api.pixwith.ai/api/task/createHeaders
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Api-Key | {API_KEY} | Yes |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | The input prompt (e.g., “A cat walking in the garden”) |
| image_urls | array | Conditional | [“https://cdn.pixwith.ai/xxx.jpg ”]. Provide 1 image (first_frame_image). |
| model_id | string | Yes | 2-3 |
| options | object | Yes | Configuration options for the task |
| options.prompt_optimization | boolean | Yes | If true, all prompt words will be automatically translated into English. |
| options.resolution | string | Yes | Resolution of the output. Valid values: '512p', '768p', or '1080p' |
| options.duration | int | Yes | Duration in seconds. Valid values: 6 or 10 |
Example Request - Text-to-Video
{
"prompt": "A cat walking in the garden",
"model_id": "2-3",
"options": {
"prompt_optimization": true,
"resolution": "512p",
"duration": 6
}
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | int | 1=success, 0=error |
| message | string | Success and failure messages |
| data | object | |
| data.task_id | string | |
| data.estimated_time | int | Estimated time in seconds |
Response
{
"code": 1,
"message": "success",
"data": {
"task_id": "d425ab4dc256f0ebaa84862b9cea8a3d",
"estimated_time": 240
}
}Last updated on