Hailuo 图生视频
curl --request POST \
--url https://api.powertokens.ai/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "MiniMax-Hailuo-2.3-Fast",
"image": "https://example.com/assets/first-frame.png",
"prompt": "The girl looks at the camera and smiles.",
"seconds": "6",
"size": "720P"
}
'import requests
url = "https://api.powertokens.ai/v1/videos"
payload = {
"model": "MiniMax-Hailuo-2.3-Fast",
"image": "https://example.com/assets/first-frame.png",
"prompt": "The girl looks at the camera and smiles.",
"seconds": "6",
"size": "720P"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'MiniMax-Hailuo-2.3-Fast',
image: 'https://example.com/assets/first-frame.png',
prompt: 'The girl looks at the camera and smiles.',
seconds: '6',
size: '720P'
})
};
fetch('https://api.powertokens.ai/v1/videos', 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.powertokens.ai/v1/videos",
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([
'model' => 'MiniMax-Hailuo-2.3-Fast',
'image' => 'https://example.com/assets/first-frame.png',
'prompt' => 'The girl looks at the camera and smiles.',
'seconds' => '6',
'size' => '720P'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.powertokens.ai/v1/videos"
payload := strings.NewReader("{\n \"model\": \"MiniMax-Hailuo-2.3-Fast\",\n \"image\": \"https://example.com/assets/first-frame.png\",\n \"prompt\": \"The girl looks at the camera and smiles.\",\n \"seconds\": \"6\",\n \"size\": \"720P\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.powertokens.ai/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"MiniMax-Hailuo-2.3-Fast\",\n \"image\": \"https://example.com/assets/first-frame.png\",\n \"prompt\": \"The girl looks at the camera and smiles.\",\n \"seconds\": \"6\",\n \"size\": \"720P\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/v1/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"MiniMax-Hailuo-2.3-Fast\",\n \"image\": \"https://example.com/assets/first-frame.png\",\n \"prompt\": \"The girl looks at the camera and smiles.\",\n \"seconds\": \"6\",\n \"size\": \"720P\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"task_id": "<string>",
"object": "video",
"model": "<string>",
"status": "queued",
"progress": 0,
"created_at": 123
}{
"code": "bad_request_body",
"message": "请求体格式错误或字段取值非法",
"data": null
}{
"code": "access_denied",
"message": "无效的令牌",
"data": null
}{
"code": "read_request_body_failed",
"message": "请求体过大,请缩小输入后重试",
"data": null
}{
"code": "insufficient_user_quota",
"message": "当前账户额度不足,请稍后重试",
"data": null
}{
"code": "gen_relay_info_failed",
"message": "服务内部处理失败,请稍后重试",
"data": null
}{
"code": "bad_response_status_code",
"message": "上游服务返回了无效响应",
"data": null
}{
"code": "get_channel_failed",
"message": "当前模型暂时无可用渠道,请稍后重试",
"data": null
}MiniMax
MiniMax-Hailuo-2.3-Fast 图生视频
适用于 MiniMax-Hailuo-2.3-Fast 图生视频模型。提交任务后,请通过 GET /v1/videos/{task_id} 查询状态。
公开字段:model、image、prompt、seconds、size。
POST
/
v1
/
videos
Hailuo 图生视频
curl --request POST \
--url https://api.powertokens.ai/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "MiniMax-Hailuo-2.3-Fast",
"image": "https://example.com/assets/first-frame.png",
"prompt": "The girl looks at the camera and smiles.",
"seconds": "6",
"size": "720P"
}
'import requests
url = "https://api.powertokens.ai/v1/videos"
payload = {
"model": "MiniMax-Hailuo-2.3-Fast",
"image": "https://example.com/assets/first-frame.png",
"prompt": "The girl looks at the camera and smiles.",
"seconds": "6",
"size": "720P"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'MiniMax-Hailuo-2.3-Fast',
image: 'https://example.com/assets/first-frame.png',
prompt: 'The girl looks at the camera and smiles.',
seconds: '6',
size: '720P'
})
};
fetch('https://api.powertokens.ai/v1/videos', 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.powertokens.ai/v1/videos",
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([
'model' => 'MiniMax-Hailuo-2.3-Fast',
'image' => 'https://example.com/assets/first-frame.png',
'prompt' => 'The girl looks at the camera and smiles.',
'seconds' => '6',
'size' => '720P'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.powertokens.ai/v1/videos"
payload := strings.NewReader("{\n \"model\": \"MiniMax-Hailuo-2.3-Fast\",\n \"image\": \"https://example.com/assets/first-frame.png\",\n \"prompt\": \"The girl looks at the camera and smiles.\",\n \"seconds\": \"6\",\n \"size\": \"720P\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.powertokens.ai/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"MiniMax-Hailuo-2.3-Fast\",\n \"image\": \"https://example.com/assets/first-frame.png\",\n \"prompt\": \"The girl looks at the camera and smiles.\",\n \"seconds\": \"6\",\n \"size\": \"720P\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/v1/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"MiniMax-Hailuo-2.3-Fast\",\n \"image\": \"https://example.com/assets/first-frame.png\",\n \"prompt\": \"The girl looks at the camera and smiles.\",\n \"seconds\": \"6\",\n \"size\": \"720P\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"task_id": "<string>",
"object": "video",
"model": "<string>",
"status": "queued",
"progress": 0,
"created_at": 123
}{
"code": "bad_request_body",
"message": "请求体格式错误或字段取值非法",
"data": null
}{
"code": "access_denied",
"message": "无效的令牌",
"data": null
}{
"code": "read_request_body_failed",
"message": "请求体过大,请缩小输入后重试",
"data": null
}{
"code": "insufficient_user_quota",
"message": "当前账户额度不足,请稍后重试",
"data": null
}{
"code": "gen_relay_info_failed",
"message": "服务内部处理失败,请稍后重试",
"data": null
}{
"code": "bad_response_status_code",
"message": "上游服务返回了无效响应",
"data": null
}{
"code": "get_channel_failed",
"message": "当前模型暂时无可用渠道,请稍后重试",
"data": null
}授权
在请求头中传入 Authorization: Bearer <token>。
请求体
application/json
模型名称。可用值:MiniMax-Hailuo-2.3-Fast。
可用选项:
MiniMax-Hailuo-2.3-Fast 将指定图片作为视频的起始帧。支持公网 URL 或 Base64 编码的 Data URL (data:image/jpeg;base64,...)
- 图片要求:
- 格式:JPG, JPEG, PNG, WebP
- 体积:小于 20MB
- 尺寸:短边像素大于 300px,长宽比在 2:5 和 5:2 之间
视频的文本描述,最大 2000 字符。对于 MiniMax-Hailuo-2.3-Fast 模型,支持使用 [指令] 语法进行运镜控制。
可在 prompt 中通过 [指令] 格式添加运镜指令,以实现精确的镜头控制。
-
支持 15 种运镜指令的指令:
- 左右移: [左移], [右移]
- 左右摇: [左摇], [右摇]
- 推拉: [推进], [拉远]
- 升降: [上升], [下降]
- 上下摇: [上摇], [下摇]
- 变焦: [变焦推近], [变焦拉远]
- 其他: [晃动], [跟随], [固定]
-
使用规则:
- 组合运镜: 同一组 [] 内的多个指令会同时生效,如 [左摇,上升],建议组合不超过 3 个
- 顺序运镜: prompt 中前后出现的指令会依次生效,如 "...[推进], 然后...[拉远]"
- 自然语言: 也支持通过自然语言描述运镜,但使用标准指令能获得更准确的响应
Maximum string length:
2000视频时长(秒),默认值为 6。其可用值与分辨率相关:
| Model | 768P | 1080P |
|---|---|---|
| MiniMax-Hailuo-2.3-Fast | 6 或 10 | 6 |
可用选项:
6, 10 视频分辨率。其可用值与模型相关:
| Model | 6s | 10s |
|---|---|---|
| MiniMax-Hailuo-2.3-Fast | 768P (默认), 1080P | 768P (默认) |
可用选项:
768P, 1080P ⌘I