- 异步处理模式,返回任务 ID 用于后续查询
- 支持文生视频、图生视频(首帧 / 尾帧 / 首尾帧)、多模态参考生视频(参考图 + 参考视频 + 参考音频)
- 支持 2K / 768P 分辨率,时长 4 ~ 15 秒,带音轨
- 与 MiniMax-Hailuo-02 / MiniMax-Hailuo-2.3 共用统一提交与查询接口
请求示例
bash
curl --request POST \
--url https://api.openveer.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}'
```python
import requests
url = "https://api.openveer.com/v1/videos/generations"
payload = {
"model": "MiniMax-H3",
"prompt": "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}
headers = {
"Authorization": "Bearer
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = "https://api.openveer.com/v1/videos/generations";
const payload = {
model: "MiniMax-H3",
prompt: "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
duration: 5,
resolution: "2K",
aspect_ratio: "16:9"
};
const headers = {
"Authorization": "Bearer
"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));
```
```go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.openveer.com/v1/videos/generations"
payload := map[string]interface{}{
"model": "MiniMax-H3",
"prompt": "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
"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))
}
```
```java
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.openveer.com/v1/videos/generations";
String payload = """
{
"model": "MiniMax-H3",
"prompt": "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
"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
"MiniMax-H3",
"prompt" => "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
"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
```
```ruby
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.openveer.com/v1/videos/generations")
payload = {
model: "MiniMax-H3",
prompt: "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
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
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
puts response.body
```
```swift
import Foundation
let url = URL(string: "https://api.openveer.com/v1/videos/generations")!
let payload: [String: Any] = [
"model": "MiniMax-H3",
"prompt": "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer
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()
```
```csharp
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.openveer.com/v1/videos/generations";
var payload = @"{
""model"": ""MiniMax-H3"",
""prompt"": ""一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜"",
""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);
}
}
```
响应示例
json
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
json
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
json
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
json
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
json
{
"error": {
"code": 422,
"message": "内容安全审核未通过",
"type": "invalid_request_error"
}
}
json
{
"error": {
"code": 429,
"message": "请求过于频繁,请稍后再试",
"type": "rate_limit_error"
}
}
json
{
"error": {
"code": 500,
"message": "服务器内部错误,请稍后重试",
"type": "server_error"
}
}
认证
Authorization string生成模式
MiniMax-H3 通过请求字段自动路由到对应模式,无需指定 mode 字段:
| 模式 | 触发条件 | 能力 |
|---|---|---|
| 文生视频(T2V) | 只传 prompt 及通用字段 |
纯文本驱动生成 |
| 图生视频(I2V) | 传入 first_frame_image / last_frame_image(或 image_with_roles 中的 first_frame / last_frame) |
首帧、尾帧、首尾帧控制 |
| 多模态参考(R2V) | 传入 image_urls / video_urls / audio_urls,或 image_with_roles 中的 reference_image |
参考图 + 参考视频 + 参考音频 |
请求参数
通用字段
model stringprompt stringduration integerresolution stringaspect_ratio stringwatermark booleanwebhook string图生视频字段
要做首帧 / 尾帧图生视频,必须显式指定,不要依赖 image_urls 张数推断。
first_frame_image stringlast_frame_image string多模态参考字段
image_urls string[]video_urls string[]audio_urls string[]通用图片数组(可选写法)
image_with_roles object[]宽高比规则
| 场景 | aspect_ratio 行为 |
|---|---|
| 文生视频(只有 prompt) | 必须是具体比例;不传或传 adaptive 会回落到 16:9 |
| 图生视频(有首 / 尾帧) | 由输入图片决定,传什么都会被忽略(恒 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 |
| 长宽比(宽/高) | 0.4 \~ 2.5 |
| 数量 | 首帧 ≤ 1、尾帧 ≤ 1、参考图 ≤ 9 |
视频(仅多模态参考场景)
| 项 | 限制 |
|---|---|
| 格式 | MP4(.mp4)、MOV(.mov) |
| 编码 | 视频 H.264/AVC、H.265/HEVC;音频 AAC、MP3 |
| 单文件 | ≤ 50 MB |
| 个数 | ≤ 3 |
| 时长 | 单段 2 \~ 15 s;总时长 ≤ 15 s |
| 宽高 / 长宽比 / 帧率 | 256 \~ 5760 px / 0.4 \~ 2.5 / 23.976 \~ 60 |
音频(仅多模态参考场景)
| 项 | 限制 |
|---|---|
| 格式 | WAV、MP3 |
| 单文件 | ≤ 15 MB |
| 个数 | ≤ 3 |
| 时长 | 单段 2 \~ 15 s;总时长 ≤ 15 s |
参数约束
以下约束违反时请求将被拒绝并返回 400(敏感内容可能返回 422),且 不产生计费:
| 参数 | 约束 |
|---|---|
prompt |
任何场景必填且非空,≤ 7000 字符 |
duration |
仅接受 4 \~ 15 的整数 |
resolution |
2K(默认)或 768P |
aspect_ratio |
见「宽高比规则」;文生不传时回落 16:9 |
| 首尾帧与参考素材 | 互斥,不能混用 |
audio_urls |
不能单独输入,须搭配参考图或参考视频 |
| 参考图 | ≤ 9 |
| 参考视频 | ≤ 3 |
| 参考音频 | ≤ 3 |
| 参考视频探测失败 | 返回 input_video_probe_failed(URL 不可访问或文件损坏),未扣费 |
响应
code integerdata arraytask_id string请求示例
场景 1:文生视频
{
"model": "MiniMax-H3",
"prompt": "一个男孩在海边打篮球,黄昏,海浪拍岸,电影感运镜",
"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": "镜头从清晨缓慢过渡到日落",
"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": "角色说话:Follow the wind, live free. Leave worries behind, enjoy the moment,音色参考音频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": "镜头从清晨缓慢过渡到日落",
"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
}