# Novita AI Minimax Hailuo-02 API | Generate videos from prompts or images

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/api-reference/model-apis-minimax-hailuo-02

# Minimax Hailuo-02

POST

/

v3

/

async

/

minimax-hailuo-02

Try it

Minimax Hailuo-02

cURL

```
curl --request POST \
--url https://api.novita.ai/v3/async/minimax-hailuo-02 \
--header 'Authorization: &#x3C;authorization>' \
--header 'Content-Type: &#x3C;content-type>' \
--data '
{
"prompt": "&#x3C;string>",
"image": "&#x3C;string>",
"end_image": "&#x3C;string>",
"duration": 123,
"resolution": "&#x3C;string>",
"enable_prompt_expansion": true,
"fast_pretreatment": true
}
'
```

```
import requestsurl = "https://api.novita.ai/v3/async/minimax-hailuo-02"payload = { "prompt": "&#x3C;string>", "image": "&#x3C;string>", "end_image": "&#x3C;string>", "duration": 123, "resolution": "&#x3C;string>", "enable_prompt_expansion": True, "fast_pretreatment": True}headers = { "Content-Type": "&#x3C;content-type>", "Authorization": "&#x3C;authorization>"}response = requests.post(url, json=payload, headers=headers)print(response.text)
```

```
const options = { method: 'POST', headers: {'Content-Type': '&#x3C;content-type>', Authorization: '&#x3C;authorization>'}, body: JSON.stringify({ prompt: '&#x3C;string>', image: '&#x3C;string>', end_image: '&#x3C;string>', duration: 123, resolution: '&#x3C;string>', enable_prompt_expansion: true, fast_pretreatment: true })};fetch('https://api.novita.ai/v3/async/minimax-hailuo-02', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
```

```
&#x3C;?php$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => "https://api.novita.ai/v3/async/minimax-hailuo-02", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode([ 'prompt' => '&#x3C;string>', 'image' => '&#x3C;string>', 'end_image' => '&#x3C;string>', 'duration' => 123, 'resolution' => '&#x3C;string>', 'enable_prompt_expansion' => true, 'fast_pretreatment' => true ]), CURLOPT_HTTPHEADER => [ "Authorization: &#x3C;authorization>", "Content-Type: &#x3C;content-type>" ],]);$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}
```

```
package mainimport (	"fmt"	"strings"	"net/http"	"io")func main() {	url := "https://api.novita.ai/v3/async/minimax-hailuo-02"	payload := strings.NewReader("{\n \"prompt\": \"&#x3C;string>\",\n \"image\": \"&#x3C;string>\",\n \"end_image\": \"&#x3C;string>\",\n \"duration\": 123,\n \"resolution\": \"&#x3C;string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true\n}")	req, _ := http.NewRequest("POST", url, payload)	req.Header.Add("Content-Type", "&#x3C;content-type>")	req.Header.Add("Authorization", "&#x3C;authorization>")	res, _ := http.DefaultClient.Do(req)	defer res.Body.Close()	body, _ := io.ReadAll(res.Body)	fmt.Println(string(body))}
```

```
HttpResponse&#x3C;String> response = Unirest.post("https://api.novita.ai/v3/async/minimax-hailuo-02") .header("Content-Type", "&#x3C;content-type>") .header("Authorization", "&#x3C;authorization>") .body("{\n \"prompt\": \"&#x3C;string>\",\n \"image\": \"&#x3C;string>\",\n \"end_image\": \"&#x3C;string>\",\n \"duration\": 123,\n \"resolution\": \"&#x3C;string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true\n}") .asString();
```

```
require 'uri'require 'net/http'url = URI("https://api.novita.ai/v3/async/minimax-hailuo-02")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Post.new(url)request["Content-Type"] = '&#x3C;content-type>'request["Authorization"] = '&#x3C;authorization>'request.body = "{\n \"prompt\": \"&#x3C;string>\",\n \"image\": \"&#x3C;string>\",\n \"end_image\": \"&#x3C;string>\",\n \"duration\": 123,\n \"resolution\": \"&#x3C;string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true\n}"response = http.request(request)puts response.read_body
```

200

```
{
"task_id": "&#x3C;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](/docs/api-reference/model-apis-task-result) to retrieve the video generation results.

##

[​](#request-headers)

Request Headers

[​](#param-content-type)

Content-Type

string

required

Supports: `application/json`

[​](#param-authorization)

Authorization

string

required

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

##

[​](#request-body)

Request Body

[​](#param-prompt)

prompt

string

required

Prompt text required to guide the generation.Range: `1 <= x <= 2000`.

[​](#param-image)

image

string

The first frame image to be used for video generation. Supports public URL or Base64 encoding(`data:image/jpeg;base64,...`).

[​](#param-end-image)

end_image

string

The end frame image to be used for video generation. Supports public URL or Base64 encoding(`data:image/jpeg;base64,...`).

[​](#param-duration)

duration

integer

The length of the generated video in seconds. Default: `6`

Optional values: `6`, `10`

[​](#param-resolution)

resolution

string

The resolution of the generated video. Default: `768P`

- For 6-second videos: supports `768P`, `1080P`

- For 10-second videos: supports `768P` only

[​](#param-enable-prompt-expansion)

enable_prompt_expansion

boolean

Whether to enable prompt optimization.Default: `true`.

[​](#param-fast-pretreatment)

fast_pretreatment

boolean

default:false

Whether to shorten the prompt optimization time.Default: `false`.

##

[​](#response)

Response

[​](#param-task-id)

task_id

string

required

Use the task_id to request the [Task Result API](/docs/api-reference/model-apis-task-result) to retrieve the generated outputs.

##

[​](#example)

Example

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

- 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": "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}"
}
```

- 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:`

Last modified on January 13, 2026
