MiniMax H3 官方接口
curl --request POST \
--url 'https://api.example.com/{{llmApiOrigin}}/minimax/v2/video_generation' \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/{{llmApiOrigin}}/minimax/v2/video_generation"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/{{llmApiOrigin}}/minimax/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.example.com/{{llmApiOrigin}}/minimax/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_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{llmApiOrigin}}/minimax/v2/video_generation"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/{{llmApiOrigin}}/minimax/v2/video_generation")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{llmApiOrigin}}/minimax/v2/video_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body视频系列
MiniMax H3 官方接口
MiniMax H3 视频生成官方接口(文生视频 / 图生视频 / 首尾帧 / 参考)
POST
{llmApiOrigin}
/
minimax
/
v2
/
video_generation
MiniMax H3 官方接口
curl --request POST \
--url 'https://api.example.com/{{llmApiOrigin}}/minimax/v2/video_generation' \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/{{llmApiOrigin}}/minimax/v2/video_generation"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/{{llmApiOrigin}}/minimax/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.example.com/{{llmApiOrigin}}/minimax/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_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{{llmApiOrigin}}/minimax/v2/video_generation"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/{{llmApiOrigin}}/minimax/v2/video_generation")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{{llmApiOrigin}}/minimax/v2/video_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body简介
MiniMax H3 官方接口以 MiniMax 官方 API 风格提供视频生成能力,使用content[] 数组传入文本与媒体。当前仅支持 MiniMax-H3 一个模型。
| 方法 | 路径 | 说明 |
|---|---|---|
POST | /minimax/v2/video_generation | 提交视频生成任务 |
GET | /minimax/v2/query/video_generation/{task_id} | 查询任务状态与结果 |
认证
string
必填
Bearer Token,如
Bearer sk-xxxxxxxxxx提交任务
POST/minimax/v2/video_generation
curl -X POST "https://api.gzyzhuai.com/minimax/v2/video_generation" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-H3",
"content": [
{ "type": "text", "text": "A cinematic shot of a glass cube on a desk, soft daylight, slow push in" }
],
"resolution": "768P",
"duration": 4,
"ratio": "16:9"
}'
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 固定为 MiniMax-H3 |
content | array | 是 | 输入内容数组(见下) |
resolution | string | 是 | 768P 或 2K |
duration | integer | 是 | 时长(秒),范围 4-15 |
ratio | string | 否 | 画幅:21:9、16:9、4:3、1:1、3:4、9:16 |
aigc_watermark | boolean | 否 | 是否添加 AIGC 水印 |
callback_url | string | 否 | 不支持:该协议不支持回调,传了任何值(含空串、null)都会返回 400 |
content[] 类型与 role
| type | 必填字段 | 说明 |
|---|---|---|
text | text | 文本提示词 |
image_url | image_url.url | 图片输入 |
video_url | video_url.url | 视频输入 |
audio_url | audio_url.url | 音频输入 |
role 表达语义:
| role | 语义 |
|---|---|
first_frame | 首帧 |
last_frame | 尾帧 |
reference_image | 参考图 |
reference_video | 参考视频 |
reference_audio | 参考音频 |
{
"model": "MiniMax-H3",
"content": [
{ "type": "image_url", "role": "first_frame", "image_url": { "url": "https://example.com/start.png" } },
{ "type": "image_url", "role": "last_frame", "image_url": { "url": "https://example.com/end.png" } },
{ "type": "text", "text": "Make the scene transition naturally from the first to the last frame" }
],
"resolution": "768P",
"duration": 5,
"ratio": "16:9"
}
提交响应
{
"task_id": "task_1234567890"
}
查询任务
GET/minimax/v2/query/video_generation/{task_id}
curl "https://api.gzyzhuai.com/minimax/v2/query/video_generation/task_1234567890" \
-H "Authorization: Bearer sk-xxxxxxxxxx"
task.status 取值:
| 状态 | 说明 |
|---|---|
queued | 排队中 |
running | 生成中 |
succeeded | 成功(task.content.url 为视频地址) |
failed / cancelled | 失败 / 已取消 |
{
"task": {
"id": "task_1234567890",
"model": "MiniMax-H3",
"status": "succeeded",
"content": { "url": "https://example-cdn.com/path/result.mp4" },
"created_at": 1782642668,
"updated_at": 1782642876
}
}
相关页面
视频生成总览
异步流程与入口选择
视频内容获取
下载与代理获取视频文件
