curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "MiniMax-H3",
prompt: "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
duration: 5,
resolution: "2K",
aspect_ratio: "16:9"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "MiniMax-H3",
"prompt" => "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration" => 5,
"resolution" => "2K",
"aspect_ratio" => "16:9"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "MiniMax-H3",
prompt: "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
duration: 5,
resolution: "2K",
aspect_ratio: "16:9"
}
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 = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""MiniMax-H3"",
""prompt"": ""A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work"",
""duration"": 5,
""resolution"": ""2K"",
""aspect_ratio"": ""16:9""
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "Content safety review failed",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error, please retry later",
"type": "server_error"
}
}
MiniMax-H3
Генерация видео MiniMax-H3
- Асинхронный режим обработки, возвращает ID задачи для последующих запросов
- Поддержка text-to-video, image-to-video (первый / последний / первый+последний кадр) и мультимодальной генерации по ссылкам (опорные изображения + видео + аудио)
- Нативный вывод 2K, длительность 4 ~ 15 секунд, со звуковой дорожкой
- Использует те же API отправки и запроса статуса, что и MiniMax-Hailuo-02 / MiniMax-Hailuo-2.3
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "MiniMax-H3",
prompt: "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
duration: 5,
resolution: "2K",
aspect_ratio: "16:9"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "MiniMax-H3",
"prompt" => "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration" => 5,
"resolution" => "2K",
"aspect_ratio" => "16:9"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "MiniMax-H3",
prompt: "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
duration: 5,
resolution: "2K",
aspect_ratio: "16:9"
}
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 = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""MiniMax-H3"",
""prompt"": ""A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work"",
""duration"": 5,
""resolution"": ""2K"",
""aspect_ratio"": ""16:9""
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "Content safety review failed",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error, please retry later",
"type": "server_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "MiniMax-H3",
prompt: "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
duration: 5,
resolution: "2K",
aspect_ratio: "16:9"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "MiniMax-H3",
"prompt" => "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration" => 5,
"resolution" => "2K",
"aspect_ratio" => "16:9"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "MiniMax-H3",
prompt: "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
duration: 5,
resolution: "2K",
aspect_ratio: "16:9"
}
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 = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""MiniMax-H3"",
""prompt"": ""A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work"",
""duration"": 5,
""resolution"": ""2K"",
""aspect_ratio"": ""16:9""
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "Content safety review failed",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error, please retry later",
"type": "server_error"
}
}
Авторизация
string
обязательно
Все эндпоинты API требуют аутентификации по Bearer TokenПолучение API Key:Перейдите на страницу управления API Key, чтобы получить ваш API KeyДобавьте в заголовок запроса:
Authorization: Bearer YOUR_API_KEY
Режимы генерации
MiniMax-H3 автоматически выбирает подходящий режим по полям запроса. Полеmode не требуется:
| Режим | Триггер | Возможности |
|---|---|---|
| Text-to-Video (T2V) | Только prompt и общие поля | Генерация полностью по тексту |
| Image-to-Video (I2V) | first_frame_image / last_frame_image (или first_frame / last_frame в image_with_roles) | Управление первым кадром, последним кадром, первым+последним кадром |
| Multimodal Reference (R2V) | image_urls / video_urls / audio_urls или reference_image в image_with_roles | Опорные изображения + видео + аудио |
Строгое взаимоисключение: поля image-to-video (
first_frame_image / last_frame_image, а также first_frame / last_frame в image_with_roles) нельзя комбинировать с полями мультимодальной ссылки (image_urls, video_urls, audio_urls и reference_image в image_with_roles). Смешивание возвращает 400.Только аудио использовать нельзя. При передаче
audio_urls необходимо также указать хотя бы одно опорное изображение или опорное видео.Параметры запроса
Общие поля
string
обязательно
Фиксированное значение:
MiniMax-H3Поле
model обязательно и должно быть передано явно. Клиенты, уже интегрированные с Hailuo, могут переключиться, установив model в MiniMax-H3.string
обязательно
Описание содержимого видео. Обязателен и непустой в любом сценарии, максимум 7000 символов на запрос.Подробно описывайте сцену, субъекта, движение и стиль для лучших результатов.Пример:
"A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work"integer
по умолчанию:"5"
Длительность выходного видео (секунды)
- Диапазон: целое число от
4до15 - По умолчанию:
5
string
по умолчанию:"2K"
Разрешение видео
- Поддерживаемое значение: только
2K(по умолчанию)
string
Соотношение сторон. Можно также передать
size или ratio с тем же эффектом.Допустимые соотношения: 21:9, 16:9, 4:3, 1:1, 3:4, 9:16Поведение в зависимости от сценария описано ниже в разделе «Правила соотношения сторон».boolean
по умолчанию:"false"
Добавлять ли водяной знак AIGCПо умолчанию:
falseСовместимый псевдоним: aigc_watermarkstring
URL, на который отправляется уведомление при достижении задачей конечного состояния (успех / ошибка)
Используйте
webhook. Не передавайте официальный callback_url. callback_url зарезервирован для внутреннего использования и не принимается от пользователей.Поля Image-to-Video
Для image-to-video с первым / последним кадром роли нужно указывать явно. Не выводите их из количества элементов вimage_urls.
string
URL изображения первого кадраПри передаче изображение используется как начальный кадр видео.
string
URL изображения последнего кадраПри передаче изображение используется как конечный кадр. Комбинируйте с
first_frame_image для управления первым+последним кадром.Поля мультимодальной ссылки
string[]
Массив URL опорных изображений
Каждое изображение в
image_urls обрабатывается как опорное (reference_image), независимо от количества. Они никогда не сопоставляются автоматически с первым / первым+последним кадром по длине массива.- Количество: ≤ 9
string[]
Массив URL опорных видео
- Количество: ≤ 3
- Формат и ограничения: см. «Ограничения входных медиа» ниже
string[]
Массив URL опорного аудио
- Количество: ≤ 3
- Нельзя использовать отдельно; необходимо сочетать с опорным изображением или опорным видео
Общий массив изображений (опциональная форма)
object[]
Массив изображений с указанием ролей. Может заменить
Пример (первый + последний кадр):Пример (опорное изображение):
first_frame_image / last_frame_image / image_urls. Каждый элемент:Показать Элемент image_with_roles
Показать Элемент image_with_roles
{
"image_with_roles": [
{"url": "https://example.com/start.png", "role": "first_frame"},
{"url": "https://example.com/end.png", "role": "last_frame"}
]
}
{
"image_with_roles": [
{"url": "https://example.com/char.png", "role": "reference_image"}
]
}
Правила соотношения сторон
| Сценарий | Поведение aspect_ratio |
|---|---|
| Text-to-video (только prompt) | Должно быть конкретное соотношение; при отсутствии или adaptive используется fallback 16:9 |
| Image-to-video (первый / последний кадр) | Определяется входным изображением; любое значение игнорируется (всегда adaptive) |
| Мультимодальная ссылка | Опционально, по умолчанию adaptive; можно также задать явное соотношение |
21:9, 16:9, 4:3, 1:1, 3:4, 9:16.
Ограничения входных медиа
Общий размер тела запроса ≤ 64 MB. Для больших файлов используйте публичные URL; не используйте Base64.Изображения
| Параметр | Ограничение |
|---|---|
| Формат | JPG / JPEG / PNG / WEBP / HEIC / HEIF |
| На файл | ≤ 30 MB |
| Ширина / высота | 256 ~ 5760 px |
| Соотношение сторон (w/h) | 0.4 ~ 2.5 |
| Количество | Первый кадр ≤ 1, последний кадр ≤ 1, опорные изображения ≤ 9 |
Видео (только мультимодальная ссылка)
| Параметр | Ограничение |
|---|---|
| Формат | MP4 (.mp4), MOV (.mov) |
| Кодек | Видео H.264/AVC, H.265/HEVC; аудио AAC, MP3 |
| На файл | ≤ 50 MB |
| Количество | ≤ 3 |
| Длительность | На клип 2 ~ 15 с; суммарная длительность ≤ 15 с |
| Размер / соотношение / FPS | 256 ~ 5760 px / 0.4 ~ 2.5 / 23.976 ~ 60 |
Аудио (только мультимодальная ссылка)
| Параметр | Ограничение |
|---|---|
| Формат | WAV, MP3 |
| На файл | ≤ 15 MB |
| Количество | ≤ 3 |
| Длительность | На клип 2 ~ 15 с; суммарная длительность ≤ 15 с |
Ограничения параметров
Нарушения отклоняются с кодом 400 (чувствительный контент может вернуть 422) и не тарифицируются:| Параметр | Ограничение |
|---|---|
prompt | Обязателен и непустой в любом сценарии, ≤ 7000 символов |
duration | Только целое число от 4 до 15 |
resolution | Только 2K |
aspect_ratio | См. «Правила соотношения сторон»; в T2V при отсутствии используется fallback 16:9 |
| Первый/последний кадр vs опорные ресурсы | Взаимоисключающие, нельзя смешивать |
audio_urls | Нельзя использовать отдельно; необходимо сочетать с опорным изображением или видео |
| Опорные изображения | ≤ 9 |
| Опорные видео | ≤ 3 |
| Опорное аудио | ≤ 3 |
| Ошибка probe опорного видео | Возвращает input_video_probe_failed (URL недоступен или файл повреждён), без тарификации |
Ответ
integer
Код статуса ответа, 200 при успехе
array
Примеры запросов
Сценарий 1: Текст в видео
{
"model": "MiniMax-H3",
"prompt": "A boy playing basketball by the sea at dusk, waves crashing, cinematic camera work",
"duration": 6,
"resolution": "2K",
"aspect_ratio": "16:9"
}
Сценарий 2: Изображение в видео — первый кадр
{
"model": "MiniMax-H3",
"prompt": "Pull focus to the people in the background and add more steam to the ramen bowl.",
"first_frame_image": "https://cdn.example.com/ramen.png",
"duration": 5,
"resolution": "2K"
}
Сценарий 3: Изображение в видео — первый + последний кадр
{
"model": "MiniMax-H3",
"prompt": "Camera slowly transitions from morning light to sunset",
"first_frame_image": "https://cdn.example.com/morning.png",
"last_frame_image": "https://cdn.example.com/sunset.png",
"duration": 8
}
Сценарий 4: Мультимодальная генерация по ссылкам
{
"model": "MiniMax-H3",
"prompt": "Character speaks: Follow the wind, live free. Leave worries behind, enjoy the moment. Voice references audio 1",
"image_with_roles": [
{"url": "https://cdn.example.com/char.png", "role": "reference_image"}
],
"video_urls": ["https://cdn.example.com/ref_motion.mp4"],
"audio_urls": ["https://cdn.example.com/ref_voice.mp3"],
"duration": 5,
"resolution": "2K"
}
Сценарий 5: Первый + последний кадр через image_with_roles
{
"model": "MiniMax-H3",
"prompt": "Camera slowly transitions from morning light to sunset",
"image_with_roles": [
{"url": "https://cdn.example.com/morning.png", "role": "first_frame"},
{"url": "https://cdn.example.com/sunset.png", "role": "last_frame"}
],
"duration": 8
}
Запрос результатов задачиГенерация видео — асинхронная задача, которая при отправке возвращает
task_id. Используйте эндпоинт Получение статуса задачи для опроса прогресса и результатов.Рекомендуемый интервал опроса: каждые 5 ~ 10 секунд. Таймаут клиента: 15 минут. При успехе result.videos[0].url — URL mp4. URL видео истекают примерно через 24 часа — сохраняйте их своевременно. За неудачные задачи средства возвращаются автоматически.⌘I