正在准备页面…
▥ Seedance 2.5 现已上线! ›
定价文档更新日志账号
指南概览图像 API视频 API
本页目录生成模式请求示例参数模型任务生命周期Webhook
资源模型目录定价API KeyWebhook 端点OpenAPI 规范服务状态产品动态
概览图像 API视频 API
视频 API

生成视频

运行 Seedance 2.5, Seedance 2.5 CN, Seedance 2.0, Seedance 2.0 CN, Seedance 2.0 Fast, Seedance 2.0 Fast CN, Seedance 2.0 Mini, Seedance 2.0 Mini CN。每个视频请求都会创建一个任务,您可以通过轮询或 webhook 接收结果。

生成模式

设置 mode 以选择工作流。默认为 text_to_video。选择模式以更新下方的示例。

请求示例

POSThttps://api.mlmux.com/v1/videos/generations
curl https://api.mlmux.com/v1/videos/generations \
  -H "Authorization: Bearer $MLMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "model/seedance-2.5-max",
  "prompt": "A cinematic tracking shot along a coastal road at sunrise, warm backlight, gentle camera drift",
  "mode": "text_to_video",
  "ratio": "16:9",
  "resolution": "720p",
  "duration": 8,
  "generate_audio": true,
  "route_mode": "official-cheap"
}'

参数

字段类型必填描述
modelstring是下表中的模型 ID。
promptstring是描述场景、主体、动作、镜头、光线和声音。
modestring否text_to_video(默认)、image_to_video、first_last_frame 或 multi_ref。
ratiostring否16:9、9:16、4:3、3:4、1:1、21:9,模型表中列出时也可用 adaptive。默认为 adaptive。
resolutionstring否根据模型支持情况可选 480p、720p、1080p 或 4K。默认为 720p。
durationinteger否片段时长(秒),须在模型支持范围内。默认为 5。设为 -1 可由模型自行选择。
generate_audioboolean否随视频片段生成同步音频。
route_modestring否official 或 official-cheap。默认使用 API Key 的路由模式,其次为 official-cheap。
image_urlstring条件必填image_to_video 模式下必填:起始帧。
first_frame_url
last_frame_url
string条件必填first_last_frame 模式下必填。也可以改为传入两个按序排列的 image_urls。
image_urlsstring[]条件必填用于 multi_ref 的参考图片。
video_urls
audio_urls
string[]条件必填用于 multi_ref 的参考视频和音频。

multi_ref 至少需要一个参考文件。Seedance 2.5 最多支持 30 张图片、10 个视频和 10 个音频文件(总共 50 个);其他模型最多支持 9 张图片、3 个视频和 3 个音频文件(总共 12 个)。请使用公开的 https URL,或先通过 POST /v1/uploads 上传文件。

模型

模型模型 ID分辨率宽高比时长
Seedance 2.5model/seedance-2.5-max480p · 720p · 1080padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–30 秒
Seedance 2.5 CNmodel/seedance-2.5-cn-max480p · 720p · 1080padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–30 秒
Seedance 2.0model/seedance-2.0-max480p · 720p · 1080p · 4Kadaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 CNmodel/seedance-2.0-cn-max480p · 720p · 1080p · 4Kadaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 Fastmodel/seedance-2.0-fast-max480p · 720padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 Fast CNmodel/seedance-2.0-fast-cn-max480p · 720padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 Minimodel/seedance-2.0-mini-max480p · 720padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 Mini CNmodel/seedance-2.0-mini-cn-max480p · 720padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒

这些 ID 以 -max 结尾,因此 ratio、resolution 和 duration 为可选参数,将回退至上述默认值。

任务生命周期

创建视频始终返回 HTTP 202 及任务信息。请保存其 id 并轮询 poll_url。当 status 为 succeeded 时,响应中将包含 video、usage 和 actual_charge_credits。

GEThttps://api.mlmux.com/v1/videos/generations/{task_id}
202 Accepted
{
  "id": "task_01a9...",
  "object": "video.generation.task",
  "status": "queued",
  "created": 1767225600,
  "model": "model/seedance-2.5-max",
  "api_method": "videos.generations.create",
  "poll_url": "/v1/videos/generations/task_01a9...",
  "progress": 0,
  "message": "queued",
  "estimated_charge_credits": 1.84
}
成功
{
  "id": "task_01a9...",
  "object": "video.generation.task",
  "status": "succeeded",
  "progress": 100,
  "message": "completed",
  "video": "https://.../generated/01a9....mp4",
  "last_frame_image": "https://.../generated/01a9....jpg",
  "usage": {
    "output_tokens": 172800,
    "video_seconds": 8,
    "video_resolution": "720p"
  },
  "estimated_charge_credits": 1.84,
  "actual_charge_credits": 1.79
}

失败的任务 status 为 failed,具体原因见 message。输出 URL 由 MLMux 托管,请及时下载需要保留的文件。

Webhook

除了轮询,您还可以订阅 request.succeeded 和 request.failed 事件。有关 Payload 结构和签名验证,请参阅 Webhook。

上一页图像 API下一页模型目录