https://biz.anyroute.iotask_xxxresolution。Seedance-2.0-480p
Seedance-2.0-720p
Seedance-2.0-1080p
Seedance-2.0-4k
Seedance-2.0-fast-480p
Seedance-2.0-fast-720p
Seedance-2.0-mini-480p
Seedance-2.0-mini-720pSeedance-2.0-mini-480p模型每秒单价 × 请求 duration × 分组倍率duration 未提供时按 4 秒创建和计费。duration 只接受 4-15 秒内的整数。duration: -1 或通过帧数推导时长。expired 并退还该任务的全部预扣额度。usage,因为该产品按请求时长结算。type | 载荷字段 | 支持的 role |
|---|---|---|
text | text | 不传 role |
image_url | image_url.url | reference_image、first_frame、last_frame |
video_url | video_url.url | reference_video |
audio_url | audio_url.url | reference_audio |
role 时,平台会按媒体类型补为 reference_image、reference_video 或 reference_audio。文本不允许设置 role。asset:// 素材引用。multipart/form-data 文件上传。data:image/jpeg;base64,<BASE64_DATA>jpeg、png、webp、bmp、tiff、gif,格式名必须小写。单张图片解码后必须小于 30 MB。data:audio/mpeg;base64,<BASE64_DATA>wav、mp3、mpeg,格式名必须小写。单段音频不超过 15 MB,最多 3 段。参考音频不能作为唯一参考输入,必须同时提供至少一张参考图片或一个参考视频。| 素材 | 最大数量 |
|---|---|
| 参考图片 | 9 |
| 参考视频 | 3 |
| 参考音频 | 3 |
content 中的同类型出现顺序编号。Prompt 可以使用:@image1 @image2
@video1 @video2
@audio1 @audio2reference_image 对应 @image1,第二张对应 @image2。first_frame 和 last_frame 不参与普通参考图片编号。| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 公开模型名称 |
content | array | 是 | 1-64 项,至少包含一项非空文本 |
duration | integer | 否 | 4-15 秒;缺省为 4 |
ratio | string | 否 | 画面比例,以当前模型校验结果为准 |
callback_url | string | 否 | 接收平台任务回调的公网 HTTPS URL |
ratio 是生成偏好。使用首帧或尾帧时,最终画面比例还可能受到输入图片比例影响,因此不应仅依赖 ratio 推断成片尺寸。frames
resolution
seed
camera_fixed
generate_audio
watermark
return_last_frame
service_tier
execution_expires_after
priority
draft
tools400 unsupported_video_parameter,不会静默忽略。即使字段值为 0 或 false,只要显式传入仍会被拒绝。400 invalid_request。Idempotency-Key。建议每个业务订单使用一个稳定且唯一的 Key。{
"model": "Seedance-2.0-mini-480p",
"content": [
{
"type": "text",
"text": "让 @image1 中的人物走入 @image2 的城市街景,保持人物外貌一致"
},
{
"type": "image_url",
"image_url": {"url": "https://media.example.com/person.jpg"},
"role": "reference_image"
},
{
"type": "image_url",
"image_url": {"url": "https://media.example.com/city.jpg"},
"role": "reference_image"
}
],
"duration": 8,
"ratio": "16:9"
}reference_image 上增加 reference_options:{
"model": "Seedance-2.0-mini-480p",
"content": [
{
"type": "text",
"text": "人物一在城市背景中向镜头走来"
},
{
"type": "image_url",
"image_url": {"url": "https://media.example.com/person.jpg"},
"role": "reference_image",
"reference_options": {
"name": "人物一",
"role": "subject"
}
},
{
"type": "image_url",
"image_url": {"url": "https://media.example.com/city.jpg"},
"role": "reference_image",
"reference_options": {
"name": "城市背景",
"role": "background"
}
}
],
"duration": 8,
"ratio": "16:9"
}reference_options 规则:image_url + reference_image。name 或 role 之一。name 必须是有效 UTF-8,去除首尾空白后不能为空,最长 256 bytes,不能包含控制字符。role 只允许 subject 或 background。name 和 role。{
"model": "Seedance-2.0-mini-480p",
"content": [
{
"type": "text",
"text": "从第一帧平滑过渡到最后一帧,动作自然"
},
{
"type": "image_url",
"image_url": {"url": "https://media.example.com/first.jpg"},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {"url": "https://media.example.com/last.jpg"},
"role": "last_frame"
}
],
"duration": 4,
"ratio": "16:9"
}reference_options 不能用于 first_frame 或 last_frame。{
"model": "Seedance-2.0-mini-480p",
"content": [
{
"type": "text",
"text": "以 @image1 为主体,参考 @video1 的运动节奏,并使用 @audio1 作为声音与节奏参考"
},
{
"type": "image_url",
"image_url": {"url": "https://media.example.com/subject.jpg"},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {"url": "https://media.example.com/motion.mp4"},
"role": "reference_video"
},
{
"type": "audio_url",
"audio_url": {"url": "https://media.example.com/music.mp3"},
"role": "reference_audio"
}
],
"duration": 4,
"ratio": "16:9"
}{
"model": "Seedance-2.0-mini-480p",
"content": [
{
"type": "text",
"text": "参考图片主体和音频节奏生成短视频"
},
{
"type": "image_url",
"image_url": {"url": "data:image/png;base64,<IMAGE_BASE64>"},
"role": "reference_image"
},
{
"type": "audio_url",
"audio_url": {"url": "data:audio/mpeg;base64,<AUDIO_BASE64>"},
"role": "reference_audio"
}
],
"duration": 4,
"ratio": "16:9"
}200:{
"id": "task_xxx"
}202,响应中仍包含同一个 task_xxx。此时不要重新提交,应查询该任务。{
"id": "task_xxx",
"model": "Seedance-2.0-mini-480p",
"status": "succeeded",
"progress": 100,
"error": null,
"created_at": 1783670400,
"updated_at": 1783670580,
"content": {
"video_url": "https://biz.anyroute.io/v1/videos/task_xxx/content"
},
"duration": 4,
"ratio": "16:9"
}queued | running | cancelled | succeeded | failed | expiredprogress 为 0-100 的归一化整数。所有终态均为 100;非终态最多为 99。只有成功任务才会返回视频结果地址。return_last_frame,因此任务不会返回 last_frame_url。任务详情也不会返回 Prompt、输入媒体 URL、Base64 内容、内部处理信息或原始结果地址。{
"id": "task_xxx",
"model": "Seedance-2.0-mini-480p",
"status": "failed",
"progress": 100,
"error": {
"code": "video_generation_failed",
"message": "video generation failed"
},
"created_at": 1783670400,
"updated_at": 1783670580,
"duration": 4,
"ratio": "16:9"
}| 参数 | 说明 |
|---|---|
page_num | 默认 1,范围 1-500 |
page_size | 默认 20,范围 1-500 |
filter.status | 可重复,筛选任务状态 |
filter.task_ids | 可重复,最多 100 个任务 ID |
filter.model | 按公开模型名称筛选 |
{
"items": [],
"total": 0
}private, no-store 缓存策略。410 video_result_expiredcontent.video_url。callback_url。平台在任务状态变化时向该地址发送 POST 回调。event_id 去重。回调失败不会改变任务状态、结果或计费。{
"event_id": "evt_xxx",
"type": "succeeded",
"created_at": 1783670580,
"data": {
"id": "task_xxx",
"model": "Seedance-2.0-mini-480p",
"status": "succeeded",
"error": null,
"created_at": 1783670400,
"updated_at": 1783670580,
"version": 4,
"content": {
"video_url": "https://biz.anyroute.io/v1/videos/task_xxx/content"
},
"duration": 4,
"ratio": "16:9"
}
}X-New-Api-Event-Id
X-New-Api-Task-Id
X-New-Api-Timestamp
X-New-Api-Signature: v1=<hex hmac-sha256>new-api-video-callback-v1,无 salt。签名内容为:timestamp + "\n" + event_id + "\n" + raw_request_bodyevent_id 去重处理。/v1/videos 兼容接口input_reference、image 或 images。seconds 可以是整数或整数字符串;也可以改用整数 duration。同时传 seconds 和 duration 时,两者必须相等。size、resolution 或其他第 4.2 节列出的字段。reference_options 应通过 content 表达:{
"model": "Seedance-2.0-mini-480p",
"prompt": "人物一自然转身并看向镜头",
"content": [
{
"type": "image_url",
"image_url": {"url": "https://media.example.com/person.jpg"},
"role": "reference_image",
"reference_options": {
"name": "人物一",
"role": "subject"
}
}
],
"duration": 4,
"ratio": "16:9"
}content 放在 metadata.content 中,但不能同时在顶层和 metadata 中提供。V1 同样只接受 JSON,不支持 Multipart。{
"id": "task_xxx",
"task_id": "task_xxx",
"object": "video",
"model": "Seedance-2.0-mini-480p",
"status": "completed",
"progress": 100,
"created_at": 1783670400,
"completed_at": 1783670580,
"seconds": "4",
"metadata": {
"url": "https://biz.anyroute.io/v1/videos/task_xxx/content",
"video_url": "https://biz.anyroute.io/v1/videos/task_xxx/content"
}
}queued | in_progress | completed | failedIdempotency-Key:POST /api/v3/contents/generations/tasksPOST /v1/videos409 idempotency_conflict。409 idempotency_in_progress。task_xxx,不要为同一业务订单生成新 Key。duration 预扣额度。正常终态处理规则如下:| 终态 | 计费结果 |
|---|---|
succeeded | 按请求 duration 结算 |
failed | 退还该任务的全部预扣额度 |
expired | 对 24 小时未确定任务执行全额退款 |
duration 为准,不按媒体容器元数据反向调整。| 接口或操作 | 说明 |
|---|---|
/v1/assets | 不提供私有素材库 |
/v1/asset-groups | 不提供素材组 |
/v1/assets/public | 不提供公域人物目录 |
| 真人授权会话 | 不提供独立真人授权接口 |
asset://... | 不能在视频请求中引用平台素材 ID |
multipart/form-data | 不接收文件上传 |
DELETE /api/v3/contents/generations/tasks/{task_id} | 不支持取消或删除任务,返回 task_delete_not_supported |
GET /v1/videos/{task_id}/last-frame | 不生成独立尾帧结果 |
{
"error": {
"message": "request contains an unsupported parameter",
"type": "unsupported_video_parameter",
"code": "unsupported_video_parameter"
}
}error.code,不要依赖 message 文案。| HTTP | code | 含义 |
|---|---|---|
| 400 | invalid_request | JSON、字段、参数范围、Base64 或 URL 不合法 |
| 400 | unsupported_video_parameter | 当前模型不支持该字段、role 或参数组合 |
| 400 | invalid_idempotency_key | 幂等 Key 不合法 |
| 400 | task_delete_not_supported | 当前产品不支持取消或删除任务 |
| 404 | task_not_found | 任务不存在或不属于当前用户 |
| 409 | idempotency_conflict | 同一个幂等 Key 对应不同请求 |
| 409 | idempotency_in_progress | 幂等操作尚不能安全重放 |
| 410 | video_result_expired | 视频结果已过期且无法刷新 |
| 409 | asset_binding_unavailable | 当前模型服务暂时不可用或配置不完整 |
| 429 | video_concurrency_limit_exceeded | 当前用户的视频任务并发数已达到上限 |
| 502 | video_upstream_error | 视频生成服务返回异常响应 |
error.code 可能包含更具体的安全错误码;如果没有可公开的稳定详情,平台统一返回 video_generation_failed。1. 从价格页面取得当前 Token 可用的按秒计费模型名称
2. 准备公网 HTTPS 素材地址,或生成合规的图片/音频 Data URL
3. POST /api/v3/contents/generations/tasks,并保存 task_xxx
4. 使用 callback_url 接收状态变化,或定时查询任务详情
5. queued/running:继续等待,不要重复创建
6. succeeded:访问 content.video_url
7. failed/expired:读取 error.code,并按业务策略处理event_id 去重。