创建视频生成任务(MiniMax-H3)
curl --request POST \
--url https://api.looprouter.com/v2/video_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "一个男孩在海边打篮球,镜头缓缓拉远"
}
],
"resolution": "768P",
"duration": 5,
"ratio": "16:9"
}
'import requests
url = "https://api.looprouter.com/v2/video_generation"
payload = {
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "一个男孩在海边打篮球,镜头缓缓拉远"
}
],
"resolution": "768P",
"duration": 5,
"ratio": "16:9"
}
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-H3',
content: [{type: 'text', text: '一个男孩在海边打篮球,镜头缓缓拉远'}],
resolution: '768P',
duration: 5,
ratio: '16:9'
})
};
fetch('https://api.looprouter.com/v2/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.looprouter.com/v2/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([
'model' => 'MiniMax-H3',
'content' => [
[
'type' => 'text',
'text' => '一个男孩在海边打篮球,镜头缓缓拉远'
]
],
'resolution' => '768P',
'duration' => 5,
'ratio' => '16:9'
]),
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.looprouter.com/v2/video_generation"
payload := strings.NewReader("{\n \"model\": \"MiniMax-H3\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一个男孩在海边打篮球,镜头缓缓拉远\"\n }\n ],\n \"resolution\": \"768P\",\n \"duration\": 5,\n \"ratio\": \"16:9\"\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.looprouter.com/v2/video_generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"MiniMax-H3\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一个男孩在海边打篮球,镜头缓缓拉远\"\n }\n ],\n \"resolution\": \"768P\",\n \"duration\": 5,\n \"ratio\": \"16:9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/v2/video_generation")
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-H3\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一个男孩在海边打篮球,镜头缓缓拉远\"\n }\n ],\n \"resolution\": \"768P\",\n \"duration\": 5,\n \"ratio\": \"16:9\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "424010985738629"
}{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "<string>",
"http_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "<string>",
"http_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "<string>",
"http_code": "<string>"
},
"request_id": "<string>"
}MiniMax 系列
创建视频生成任务
提交 MiniMax-H3 异步视频生成任务,仅返回 task_id,成片需轮询查询接口获取。
文生 / 图生 / 多模态参考共用本接口,靠 content 数组组合区分模式。注意路径没有 /api 前缀。
POST
/
v2
/
video_generation
创建视频生成任务(MiniMax-H3)
curl --request POST \
--url https://api.looprouter.com/v2/video_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "一个男孩在海边打篮球,镜头缓缓拉远"
}
],
"resolution": "768P",
"duration": 5,
"ratio": "16:9"
}
'import requests
url = "https://api.looprouter.com/v2/video_generation"
payload = {
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "一个男孩在海边打篮球,镜头缓缓拉远"
}
],
"resolution": "768P",
"duration": 5,
"ratio": "16:9"
}
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-H3',
content: [{type: 'text', text: '一个男孩在海边打篮球,镜头缓缓拉远'}],
resolution: '768P',
duration: 5,
ratio: '16:9'
})
};
fetch('https://api.looprouter.com/v2/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.looprouter.com/v2/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([
'model' => 'MiniMax-H3',
'content' => [
[
'type' => 'text',
'text' => '一个男孩在海边打篮球,镜头缓缓拉远'
]
],
'resolution' => '768P',
'duration' => 5,
'ratio' => '16:9'
]),
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.looprouter.com/v2/video_generation"
payload := strings.NewReader("{\n \"model\": \"MiniMax-H3\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一个男孩在海边打篮球,镜头缓缓拉远\"\n }\n ],\n \"resolution\": \"768P\",\n \"duration\": 5,\n \"ratio\": \"16:9\"\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.looprouter.com/v2/video_generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"MiniMax-H3\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一个男孩在海边打篮球,镜头缓缓拉远\"\n }\n ],\n \"resolution\": \"768P\",\n \"duration\": 5,\n \"ratio\": \"16:9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/v2/video_generation")
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-H3\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"一个男孩在海边打篮球,镜头缓缓拉远\"\n }\n ],\n \"resolution\": \"768P\",\n \"duration\": 5,\n \"ratio\": \"16:9\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "424010985738629"
}{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "<string>",
"http_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "<string>",
"http_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "<string>",
"http_code": "<string>"
},
"request_id": "<string>"
}授权
LoopRouter API Key(sk- 开头),在控制台「令牌」页创建
请求体
application/json
固定 MiniMax-H3
生成素材数组(文本 / 图片 / 视频 / 音频)
Show child attributes
Show child attributes
输出分辨率
可用选项:
768P, 2K 输出时长(秒),4–15
画面宽高比;文生视频必填且不能为 adaptive;图生视频恒按 adaptive
可用选项:
adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 是否叠加 AIGC 水印,默认 false
任务状态变化回调地址
响应
任务创建成功
任务 ID,用于查询任务状态