curl --request POST \
--url https://api.minimax.io/v1/video_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "A mouse runs toward the camera, smiling and blinking.",
"first_frame_image": "https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg",
"model": "MiniMax-Hailuo-2.3",
"duration": 6,
"resolution": "1080P"
}
'import requests
url = "https://api.minimax.io/v1/video_generation"
payload = {
"prompt": "A mouse runs toward the camera, smiling and blinking.",
"first_frame_image": "https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg",
"model": "MiniMax-Hailuo-2.3",
"duration": 6,
"resolution": "1080P"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
prompt: 'A mouse runs toward the camera, smiling and blinking.',
first_frame_image: 'https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg',
model: 'MiniMax-Hailuo-2.3',
duration: 6,
resolution: '1080P'
})
};
fetch('https://api.minimax.io/v1/video_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimax.io/v1/video_generation",
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' => 'A mouse runs toward the camera, smiling and blinking.',
'first_frame_image' => 'https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg',
'model' => 'MiniMax-Hailuo-2.3',
'duration' => 6,
'resolution' => '1080P'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimax.io/v1/video_generation"
payload := strings.NewReader("{\n \"prompt\": \"A mouse runs toward the camera, smiling and blinking.\",\n \"first_frame_image\": \"https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg\",\n \"model\": \"MiniMax-Hailuo-2.3\",\n \"duration\": 6,\n \"resolution\": \"1080P\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimax.io/v1/video_generation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"prompt\": \"A mouse runs toward the camera, smiling and blinking.\",\n \"first_frame_image\": \"https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg\",\n \"model\": \"MiniMax-Hailuo-2.3\",\n \"duration\": 6,\n \"resolution\": \"1080P\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v1/video_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"prompt\": \"A mouse runs toward the camera, smiling and blinking.\",\n \"first_frame_image\": \"https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg\",\n \"model\": \"MiniMax-Hailuo-2.3\",\n \"duration\": 6,\n \"resolution\": \"1080P\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "106916112212032",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Image-to-Video Task
Use this API to create a video generation task from image, with optional text input.
curl --request POST \
--url https://api.minimax.io/v1/video_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "A mouse runs toward the camera, smiling and blinking.",
"first_frame_image": "https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg",
"model": "MiniMax-Hailuo-2.3",
"duration": 6,
"resolution": "1080P"
}
'import requests
url = "https://api.minimax.io/v1/video_generation"
payload = {
"prompt": "A mouse runs toward the camera, smiling and blinking.",
"first_frame_image": "https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg",
"model": "MiniMax-Hailuo-2.3",
"duration": 6,
"resolution": "1080P"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
prompt: 'A mouse runs toward the camera, smiling and blinking.',
first_frame_image: 'https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg',
model: 'MiniMax-Hailuo-2.3',
duration: 6,
resolution: '1080P'
})
};
fetch('https://api.minimax.io/v1/video_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimax.io/v1/video_generation",
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' => 'A mouse runs toward the camera, smiling and blinking.',
'first_frame_image' => 'https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg',
'model' => 'MiniMax-Hailuo-2.3',
'duration' => 6,
'resolution' => '1080P'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimax.io/v1/video_generation"
payload := strings.NewReader("{\n \"prompt\": \"A mouse runs toward the camera, smiling and blinking.\",\n \"first_frame_image\": \"https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg\",\n \"model\": \"MiniMax-Hailuo-2.3\",\n \"duration\": 6,\n \"resolution\": \"1080P\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimax.io/v1/video_generation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"prompt\": \"A mouse runs toward the camera, smiling and blinking.\",\n \"first_frame_image\": \"https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg\",\n \"model\": \"MiniMax-Hailuo-2.3\",\n \"duration\": 6,\n \"resolution\": \"1080P\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v1/video_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"prompt\": \"A mouse runs toward the camera, smiling and blinking.\",\n \"first_frame_image\": \"https://cdn.hailuoai.com/prod/2024-09-18-16/user/multi_chat_file/9c0b5c14-ee88-4a5b-b503-4f626f018639.jpeg\",\n \"model\": \"MiniMax-Hailuo-2.3\",\n \"duration\": 6,\n \"resolution\": \"1080P\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "106916112212032",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Authorizations
HTTP: Bearer Auth
- Security Scheme Type: http
- HTTP Authorization Scheme:
Bearer API_key, can be found in Account Management>API Keys.
Headers
The media type of the request body. Must be set to application/json to ensure the data is sent in JSON format.
application/json Body
Model name. Supported values: MiniMax-Hailuo-2.3, MiniMax-Hailuo-2.3-Fast, MiniMax-Hailuo-02, I2V-01-Director, I2V-01-live, I2V-01.
MiniMax-Hailuo-2.3, MiniMax-Hailuo-2.3-Fast, MiniMax-Hailuo-02, I2V-01-Director, I2V-01-live, I2V-01 Text description of the video, up to 2000 characters. For MiniMax-Hailuo-2.3, MiniMax-Hailuo-2.3-Fast, MiniMax-Hailuo-02 and I2V-01-Director models, camera movement can be controlled using [command] syntax.
-
Supported 15 camera commands:
- Truck:
[Truck left],[Truck right] - Pan:
[Pan left],[Pan right] - Push:
[Push in],[Pull out] - Pedestal:
[Pedestal up],[Pedestal down] - Tilt:
[Tilt up],[Tilt down] - Zoom:
[Zoom in],[Zoom out] - Shake:
[Shake] - Follow:
[Tracking shot] - Static:
[Static shot]
- Truck:
-
Usage rules:
- Combined movements: Multiple commands inside one
[]take effect simultaneously (e.g.,[Pan left,Pedestal up]). Recommended max: 3. - Sequential movements: Commands appear in order, e.g.,
"...[Push in], then...[Push out]". - Natural language: Free-form descriptions also work, but explicit commands yield more accurate results.
- Combined movements: Multiple commands inside one
Whether to automatically optimize the prompt. Defaults to true. Set to false for more precise control.
Reduces optimization time when prompt_optimizer is enabled. Defaults to false. Applies only to MiniMax-Hailuo-2.3, MiniMax-Hailuo-2.3-Fast and MiniMax-Hailuo-02.
Video duration (seconds). Default is 6. Supported values depend on the model and resolution:
| Model | 512P | 768P | 1080P |
|---|---|---|---|
| MiniMax-Hailuo-2.3 | - | 6 or 10 | 6 |
| MiniMax-Hailuo-2.3-Fast | - | 6 or 10 | 6 |
| MiniMax-Hailuo-02 | 6 or 10 | 6 or 10 | 6 |
Notes: The default resolution for other models is 720p.
Video resolution. Options depend on model and duration:
| Model | 6s | 10s |
|---|---|---|
| MiniMax-Hailuo-2.3 | 768P (default), 1080P | 768P (default) |
| MiniMax-Hailuo-2.3-Fast | 768P (default), 1080P | 768P (default) |
| MiniMax-Hailuo-02 | 512P, 768P (default), 1080P | 512P, 768P (default) |
| Other models | 720P (default) | Not supported |
512P, 720P, 768P, 1080P A callback URL to receive asynchronous task status updates.
- Validation: Once configured, MiniMax sends a
POSTrequest with achallengefield. Your server must echo this value within 3s to validate. - Updates: After validation, MiniMax pushes status updates when the task changes. Response structure matches the Query Video Generation Task API.
Callback status values:
"processing"– Task in progress"success"– Task completed successfully"failed"– Task failed
from fastapi import FastAPI, HTTPException, Request
import json
app = FastAPI()
@app.post("/get_callback")
async def get_callback(request: Request):
try:
json_data = await request.json()
challenge = json_data.get("challenge")
if challenge is not None:
# Validation request, echo back challenge
return {"challenge": challenge}
else:
# Status update request, handle accordingly
# {
# "task_id": "115334141465231360",
# "status": "success",
# "file_id": "205258526306433",
# "base_resp": {
# "status_code": 0,
# "status_msg": "success"
# }
# }
return {"status": "success"}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
if __name__ == "__main__":
import uvicorn
uvicorn.run(
app, # Required
host="0.0.0.0", # Required
port=8000, # Required, port can be customized
# ssl_keyfile="yourname.yourDomainName.com.key", # Optional, enable if using SSL
# ssl_certfile="yourname.yourDomainName.com.key", # Optional, enable if using SSL
)