POST
/
v3
/
async
/
minimax-hailuo-02
curl --request POST \
  --url https://api.novita.ai/v3/async/minimax-hailuo-02 \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '{
  "prompt": "<string>",
  "image_url": "<string>",
  "duration": 123,
  "resolution": "<string>",
  "enable_prompt_expansion": true
}'
{
  "task_id": "<string>"
}

Minimax Hailuo-02 (also known as Hailuo) is an AI video generation model that supports both text-to-video and image-to-video generation. It can generate 6-second videos at 768p or 1080p resolution, and 10-second videos at 768p resolution.

This is an asynchronous API; only the task_id will be returned. You should use the task_id to request the Task Result API to retrieve the video generation results.

Request Headers

Content-Type
string
required

Supports: application/json

Authorization
string
required

Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

prompt
string
required

Prompt text required to guide the generation.

Range: 1 <= x <= 2000.

image_url
string

The URL of the first frame image to be used for video generation.

duration
integer

The length of the generated video in seconds. Default: 6
Optional values: 6, 10

resolution
string

The resolution of the generated video. Default: 768P

  • For 6-second videos: supports 768P, 1080P
  • For 10-second videos: supports 768P only
enable_prompt_expansion
boolean

Whether to enable prompt optimization.

Default: true.

Response

task_id
string
required

Use the task_id to request the Task Result API to retrieve the generated outputs.

Example

Here is an example of how to use the Minimax Hailuo-02 API.

  1. Generate a task_id by sending a POST request to the Minimax Hailuo-02 API.

Request:

curl \
-X POST https://api.novita.ai/v3/async/minimax-hailuo-02 \
-H "Authorization: Bearer $your_api_key" \
-H "Content-Type: application/json" \
-d '{
  "image_url": "https://doc-assets.novitai.com/minimax-hailuo-video-02-input-image.jpg",
  "prompt": "A gentleman leans on a retro-futuristic car under a streetlight, zooming out revealing classic design elements in a timeless, nostalgic style.",
  "duration": 6,
  "resolution": "768P",
  "enable_prompt_expansion": true
}'

Response:

{
    "task_id": "{Returned Task ID}"
}
  1. Use task_id to get output videos.

HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.

You can get videos url in videos of response.

Request:

curl --location --request GET 'https://api.novita.ai/v3/async/task-result?task_id={Returned Task ID}' \
--header 'Authorization: Bearer {{API Key}}'

Response:

{
    "task": {
        "task_id": "{Returned Task ID}",
        "task_type": "MINIMAX_HAILUO_02",
        "status": "TASK_STATUS_SUCCEED",
        "reason": "",
        "eta": 0,
        "progress_percent": 100
    },
    "images": [],
    "videos": [
        {
            "video_url": "{The URL of the generated video}",
            "video_url_ttl": "3600",
            "video_type": "mp4"
        }
    ]
}

Video files: