Minimax Hailuo-02
curl --request POST \
--url https://api.ppio.com/v3/async/minimax-hailuo-02 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"image": "<string>",
"end_image": "<string>",
"duration": 123,
"resolution": "<string>",
"enable_prompt_expansion": true,
"fast_pretreatment": true,
"aigc_watermark": true
}
'import requests
url = "https://api.ppio.com/v3/async/minimax-hailuo-02"
payload = {
"prompt": "<string>",
"image": "<string>",
"end_image": "<string>",
"duration": 123,
"resolution": "<string>",
"enable_prompt_expansion": True,
"fast_pretreatment": True,
"aigc_watermark": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
prompt: '<string>',
image: '<string>',
end_image: '<string>',
duration: 123,
resolution: '<string>',
enable_prompt_expansion: true,
fast_pretreatment: true,
aigc_watermark: true
})
};
fetch('https://api.ppio.com/v3/async/minimax-hailuo-02', 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.ppio.com/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' => '<string>',
'image' => '<string>',
'end_image' => '<string>',
'duration' => 123,
'resolution' => '<string>',
'enable_prompt_expansion' => true,
'fast_pretreatment' => true,
'aigc_watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.ppio.com/v3/async/minimax-hailuo-02"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"end_image\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true,\n \"aigc_watermark\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.ppio.com/v3/async/minimax-hailuo-02")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"end_image\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true,\n \"aigc_watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/async/minimax-hailuo-02")
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"] = '<authorization>'
request.body = "{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"end_image\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true,\n \"aigc_watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}视频
Minimax Hailuo-02
POST
/
v3
/
async
/
minimax-hailuo-02
Minimax Hailuo-02
curl --request POST \
--url https://api.ppio.com/v3/async/minimax-hailuo-02 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"image": "<string>",
"end_image": "<string>",
"duration": 123,
"resolution": "<string>",
"enable_prompt_expansion": true,
"fast_pretreatment": true,
"aigc_watermark": true
}
'import requests
url = "https://api.ppio.com/v3/async/minimax-hailuo-02"
payload = {
"prompt": "<string>",
"image": "<string>",
"end_image": "<string>",
"duration": 123,
"resolution": "<string>",
"enable_prompt_expansion": True,
"fast_pretreatment": True,
"aigc_watermark": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
prompt: '<string>',
image: '<string>',
end_image: '<string>',
duration: 123,
resolution: '<string>',
enable_prompt_expansion: true,
fast_pretreatment: true,
aigc_watermark: true
})
};
fetch('https://api.ppio.com/v3/async/minimax-hailuo-02', 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.ppio.com/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' => '<string>',
'image' => '<string>',
'end_image' => '<string>',
'duration' => 123,
'resolution' => '<string>',
'enable_prompt_expansion' => true,
'fast_pretreatment' => true,
'aigc_watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.ppio.com/v3/async/minimax-hailuo-02"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"end_image\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true,\n \"aigc_watermark\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.ppio.com/v3/async/minimax-hailuo-02")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"end_image\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true,\n \"aigc_watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/async/minimax-hailuo-02")
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"] = '<authorization>'
request.body = "{\n \"prompt\": \"<string>\",\n \"image\": \"<string>\",\n \"end_image\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"enable_prompt_expansion\": true,\n \"fast_pretreatment\": true,\n \"aigc_watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Minimax Hailuo-02 是一款支持文本生成视频和图片生成视频的AI视频生成模型。它可以生成 6秒的 768P 或 1080P 分辨率视频,以及 10秒的 768P 分辨率视频。
这是一个异步API,只会返回异步任务的 task_id。您应该使用该 task_id 请求 查询任务结果 API 来检索视频生成结果。
请求头
枚举值:
application/jsonBearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
指导生成所需的提示词文本。范围:
1 <= x <= 2000。用于视频生成的首帧图片。支持公网 URL 或 Base64 编码(如
data:image/jpeg;base64,...)。用于视频生成的结束帧图片。支持公网 URL 或 Base64 编码(如
data:image/jpeg;base64,...)。生成视频的时长(秒)。默认值:
可选值:
6可选值:
6、10生成视频的分辨率。默认值:
768P- 6 秒视频支持:
768P、1080P - 10 秒视频仅支持:
768P
是否启用提示词优化。默认值:
true。是否缩短提示词优化的耗时。默认值:
false。为生成的视频添加水印。
false:不添加水印。true:在视频添加文字的水印,标识由人工智能生成合成。
响应
异步任务的 task_id。您应该使用该 task_id 请求 查询任务结果 API 以获取生成结果
示例
以下是如何使用 Minimax Hailuo-02 API 的示例。- 通过向 Minimax Hailuo-02 API 发送 POST 请求来生成 task_id。
请求:
curl \
-X POST https://api.ppio.com/v3/async/minimax-hailuo-02 \
-H "Authorization: Bearer $your_api_key" \
-H "Content-Type: application/json" \
-d '{
"image": "https://static.ppinfra.com/docs/assets/minimax-hailuo-video-02-input-image.jpg",
"prompt": "戴着太阳镜的毛茸茸的熊猫在日出时的雪山顶上跳舞,左移运镜",
"duration": 6,
"resolution": "768P",
"enable_prompt_expansion": true
}'
响应:
{
"task_id": "{返回的 Task ID}"
}
- 使用
task_id获取输出视频。
videos 字段中获取视频 url。
请求:
curl --location --request GET 'https://api.ppio.com/v3/async/task-result?task_id={返回的 Task ID}' \
--header 'Authorization: Bearer {{API Key}}'
响应:
{
"task": {
"task_id": "{返回的 Task ID}",
"task_type": "MINIMAX_HAILUO_02",
"status": "TASK_STATUS_SUCCEED",
"reason": "",
"eta": 0,
"progress_percent": 100
},
"images": [],
"videos": [
{
"video_url": "{生成视频的 URL}",
"video_url_ttl": "3600",
"video_type": "mp4"
}
]
}
视频文件:
最后修改于 2026年1月13日
⌘I