Mangogo 营业厅Mangogo 营业厅
首页API 参考Skills插件

POST /v1/multi/videos

POST/v1/multi/videos

多模态视频生成。通过 mode 指定生成模式,通过 assets[] 传入图片/视频 URL。

提交成功后,使用 GET /v1/videos/{task_id} 查询、GET /v1/videos/{task_id}/content 下载。

鉴权:Bearer Token

Content-Type:application/json

生成模式 mode

mode说明典型必填资产
t2v文生视频无
i2v图生视频image
first_frame首帧生成视频first_frame
last_frame尾帧生成视频last_frame
first_last_frame首尾帧生成视频first_frame、last_frame
ref_image参考图生成视频至少 1 条 reference_images
ref_media全能参考生成视频(多参考媒体混合)无强制媒体资产;prompt 必填,reference_images / source_video / audio 均可选
video_extend视频续写source_video
video_edit视频智能编辑source_video;可选 reference_images

各模型启用的 mode 以管理台「模型能力 → 视频能力」配置为准。

全能参考生成视频(ref_media)

ref_media(全能参考生成视频)是输入能力最强的多参考模式:在同一条提示词下,同时混合参考图片、参考视频、参考音频生成新视频,典型模型为 minimax-h3。与 ref_image 只支持参考图不同,ref_media 允许三类媒体自由组合(可只传其中任意一种或多种)。

资产角色与默认上限

assets[].role说明数量上限(默认)单文件大小上限(默认)总时长上限(默认)
reference_images参考图片4 张(可配 1–14)20MB—
source_video参考视频1 个(可配 0–14,0 表示不支持)40MB15s
audio参考音频1 个(可配 1–14)10MB15s

上限值由管理台「编辑模型 → 视频能力 → 全能参考生成视频(ref_media)」配置,C 端与 API 校验均以该配置为准;未配置时使用上表默认值。

资产字段

ref_media 模式下 assets[] 除 role、url 外,还可携带:

字段类型必填说明
rolestring是reference_images / source_video / audio
urlstring是媒体文件 URL
duration_secnumber条件媒体时长(秒);source_video 必填,audio 可选
resolutionstring否参考视频分辨率,用于计费归一(如 720p、1080p)
size_bytesinteger否文件大小(字节),用于单文件大小校验

校验规则

  • prompt 必填,最大字符数默认 6000(prompt_max_chars,可配 1–20000)
  • 所有参考资产总数(图 + 视频 + 音频之和)不超过 max_reference_items,默认 12(可配 1–100)
  • source_video 资产必须携带 duration_sec;所有参考视频时长之和不超过 max_reference_video_duration_sec,默认 15s(可配 1–600)
  • 所有参考音频时长之和不超过 max_reference_audio_duration_sec,默认 15s(可配 1–600)
  • 各类资产单文件大小分别受 max_reference_video_size_mb / max_reference_image_size_mb / max_reference_audio_size_mb 限制,默认 40MB / 20MB / 10MB(可配 1–200)
  • 传入不在允许列表中的 role 会返回 asset not allowed for mode 错误

计费说明(minimax-h3)

  • 输入参考视频时长会累加到计费时长(输入视频按输出视频相同规则计费)
  • 计费分辨率按输入参考视频分辨率归一:大于 720p 按 2k 计算,小于等于 720p 按 720p 计算;多个参考视频取最高档

请求示例:全能参考生成视频(ref_media)

{  "model": "minimax-h3",  "mode": "ref_media",  "prompt": "让参考视频中的角色穿上参考图片中的服装,并跟随参考音频的节奏起舞,保持人物身份一致",  "assets": [    { "role": "reference_images", "url": "https://example.com/character.png" },    { "role": "source_video", "url": "https://example.com/dance.mp4", "duration_sec": 8, "resolution": "1080p" },    { "role": "audio", "url": "https://example.com/bgm.mp3", "duration_sec": 10 }  ],  "resolution": "720p",  "duration_sec": 5}

请求字段

字段类型必填说明
modelstring是视频模型
modestring是生成模式
promptstring条件视频描述;多数模式必填
assetsarray条件[{ "role": "...", "url": "https://..." }]
resolutionstring否如 720p、1080p
duration_secnumber否时长(秒)
aspect_ratiostring否如 16:9、3:2
prompt_optimizeboolean否是否开启 prompt 优化
gen_tierstring否生成档位
qualitystring否画质
audio_modestring否音频模式
camera_controlstring否运镜控制
shot_typestring否镜头类型
hd_upscalestring否高清放大

请求示例:文生视频(t2v)

{  "model": "agnes-video-v2.0",  "mode": "t2v",  "prompt": "A cinematic shot of a cat walking on the beach at sunset, soft ocean waves, warm golden lighting, realistic motion",  "resolution": "720p",  "duration_sec": 5,  "aspect_ratio": "3:2",  "prompt_optimize": false}

请求示例:首帧图生视频(first_frame)

{  "model": "agnes-video-v2.0",  "mode": "first_frame",  "prompt": "The woman slowly turns around and looks back at the camera, natural facial expression, cinematic camera movement",  "assets": [    { "role": "first_frame", "url": "https://example.com/image.png" }  ],  "duration_sec": 5}

请求示例:参考图生视频(ref_image)

{  "model": "agnes-video-v2.0",  "mode": "ref_image",  "prompt": "Create a smooth transformation scene between the two reference images, cinematic lighting, consistent character identity, natural motion",  "assets": [    { "role": "reference_images", "url": "https://example.com/image1.png" },    { "role": "reference_images", "url": "https://example.com/image2.png" }  ],  "duration_sec": 5}

请求示例:视频续写(video_extend)

{  "model": "wan2.6-t2v",  "mode": "video_extend",  "prompt": "Continue the scene with the character walking into the sunset",  "assets": [    { "role": "source_video", "url": "https://example.com/source.mp4" }  ],  "duration_sec": 5,  "resolution": "720p"}

请求示例(curl)

文生视频(t2v):

curl https://www.yunsell.com/v1/multi/videos \  -H "Authorization: Bearer sk-xxx" \  -H "Content-Type: application/json" \  -d '{    "model": "agnes-video-v2.0",    "mode": "t2v",    "prompt": "A cinematic shot of a cat walking on the beach at sunset, soft ocean waves, warm golden lighting, realistic motion",    "resolution": "720p",    "duration_sec": 5,    "aspect_ratio": "3:2",    "prompt_optimize": false  }'

首帧图生视频(first_frame):

curl https://www.yunsell.com/v1/multi/videos \  -H "Authorization: Bearer sk-xxx" \  -H "Content-Type: application/json" \  -d '{    "model": "agnes-video-v2.0",    "mode": "first_frame",    "prompt": "The woman slowly turns around and looks back at the camera, natural facial expression, cinematic camera movement",    "assets": [      {"role": "first_frame", "url": "https://example.com/image.png"}    ],    "duration_sec": 5  }'

参考图生视频(ref_image):

curl https://www.yunsell.com/v1/multi/videos \  -H "Authorization: Bearer sk-xxx" \  -H "Content-Type: application/json" \  -d '{    "model": "agnes-video-v2.0",    "mode": "ref_image",    "prompt": "Create a smooth transformation scene between the two reference images, cinematic lighting, consistent character identity, natural motion",    "assets": [      {"role": "reference_images", "url": "https://example.com/image1.png"},      {"role": "reference_images", "url": "https://example.com/image2.png"}    ],    "duration_sec": 5  }'

全能参考生成视频(ref_media):

curl https://www.yunsell.com/v1/multi/videos \  -H "Authorization: Bearer sk-xxx" \  -H "Content-Type: application/json" \  -d '{    "model": "minimax-h3",    "mode": "ref_media",    "prompt": "让参考视频中的角色穿上参考图片中的服装,并跟随参考音频的节奏起舞,保持人物身份一致",    "assets": [      {"role": "reference_images", "url": "https://example.com/character.png"},      {"role": "source_video", "url": "https://example.com/dance.mp4", "duration_sec": 8, "resolution": "1080p"},      {"role": "audio", "url": "https://example.com/bgm.mp3", "duration_sec": 10}    ],    "resolution": "720p",    "duration_sec": 5  }'

视频续写(video_extend):

curl https://www.yunsell.com/v1/multi/videos \  -H "Authorization: Bearer sk-xxx" \  -H "Content-Type: application/json" \  -d '{    "model": "wan2.6-t2v",    "mode": "video_extend",    "prompt": "Continue the scene with the character walking into the sunset",    "assets": [      {"role": "source_video", "url": "https://example.com/source.mp4"}    ],    "duration_sec": 5,    "resolution": "720p"  }'

响应体

HTTP 200

{  "id": "task_abc123xyz",  "status": "queued",  "progress": 0,  "created_at": 1712697600}

响应字段

与 [POST /v1/videos](#4-post-v1videos) 创建任务响应相同。

字段类型说明
idstring任务 ID,用于后续查询和下载
statusstring初始为 queued
progressinteger进度 0–100
created_atinteger创建时间 Unix 时间戳(秒)

后续查询与下载分别使用 GET /v1/videos/{task_id} 和 GET /v1/videos/{task_id}/content,响应字段见 第 5 节 与 第 6 节。

失败响应

HTTP 400

{  "code": "invalid_request",  "message": "model and mode are required"}
{  "code": "invalid_request",  "message": "prompt is required"}

错误格式说明见 任务类错误。