Seedance 2.5(透传模式)
Seedance 2.5 透传模式:按火山方舟 Contents 协议原样提交 content[],路径为 /api/v3/contents/generations/tasks。
请求模式:透传模式(请求体按火山方舟 Contents 协议原样转发)
适用模型:seedance2.5-huoshan
BaseURL:__apiBaseUrl__
相关文档:转换模式 · Seedance 2.0(透传模式) · 素材库(用户) · 素材库(中转站)
异步任务:创建后返回任务 ID,再轮询查询。成片 URL 有时效,请及时转存。
1. 接口概览
| 项目 | 说明 |
|---|---|
| 提交任务 | POST /api/v3/contents/generations/tasks |
| 查询任务 | GET /api/v3/contents/generations/tasks/{id} |
| 提交地址 | __apiBaseUrl__/api/v3/contents/generations/tasks |
| 查询地址 | __apiBaseUrl__/api/v3/contents/generations/tasks/{id} |
| 鉴权 | Authorization: Bearer <YOUR_API_KEY> |
| 内容类型 | Content-Type: application/json |
| 模型 | seedance2.5-huoshan |
| 分辨率 | 480p / 720p(默认)/ 1080p |
| 时长 | 4~30 秒,或 -1(智能选长) |
| 宽高比 | 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9 / adaptive(默认) |
| 有声 | generate_audio 默认 true;无声须显式 false |
| 素材上限 | 参考图 ≤30;参考视频 ≤10(总时长 ≤30s);参考音频 ≤10(总时长 ≤30s) |
| 任务 ID | cgt-yyyyMMddHHmmss-xxxx,保留约 7 天 |
2. 与转换模式的差异
| 对比项 | 透传 seedance2.5-huoshan(本文) | 转换 seedance2.5 |
|---|---|---|
| 协议 | 火山方舟 Contents 原生 | 网关简化体 → 转 Contents |
| 创建路径 | /api/v3/contents/generations/tasks | /v1/video/generations |
| 查询路径 | /api/v3/contents/generations/tasks/{id} | /v1/video/generations/{id} |
| 输入形态 | content[](官方字段原样) | prompt + images / 首尾帧 / metadata |
| 成功状态 | succeeded | completed |
| 成片字段 | content.video_url | output.video_url |
| 适用 | 对齐官方 SDK / 文档 | 快速对接 |
转换写法见 Seedance 2.5(转换模式)。
3. 请求头
Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json4. 请求参数
4.1 顶层参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 固定 seedance2.5-huoshan |
content | array | 是 | 官方 content[],见下表 |
resolution | string | 否 | 480p / 720p / 1080p |
ratio | string | 否 | 首帧/首尾帧、视频编辑/延长须 adaptive |
duration | int | 否 | 4~30 或 -1;视频编辑须 -1 |
generate_audio | bool | 否 | 默认 true |
seed | int | 否 | -1 为随机 |
watermark | bool | 否 | 默认 false |
output_format | string | 否 | mp4(默认)/ mov |
draft | bool | 否 | 样片模式;开启后仅 480p |
omni_reference_task_type | string | 否 | auto / reference / edit / extend |
callback_url | string | 否 | 任务状态回调地址 |
tools | array | 否 | 如 [{"type":"web_search"}] |
请求体按火山方舟 Contents 协议原样提交,content[] 的 type / role 不要改成简化字段。
4.2 content[]
| type | 关键字段 | role |
|---|---|---|
text | text | — |
image_url | image_url.url | first_frame / last_frame / reference_image(首帧可不填 role) |
video_url | video_url.url | reference_video |
audio_url | audio_url.url | reference_audio |
draft_task | draft_task.id | 基于样片任务生成正式片 |
互斥:first_frame / last_frame 与 reference_image / reference_video / reference_audio 不可同请求混用。
4.3 生成模式对照
| 场景 | 组合 | 限制 |
|---|---|---|
| 文生视频 | 仅文本 | ratio / duration 无特殊限制 |
| 首帧 | 文本 + first_frame | ratio=adaptive |
| 首尾帧 | 文本 + first_frame + last_frame | ratio=adaptive |
| 全模态参考 | 文本 + reference_* | 可单用或组合;勿与首尾帧混用 |
| 视频编辑 | 含 reference_video + 编辑意图 | ratio=adaptive,duration=-1,视频 4~30s |
| 视频延长 | 含 reference_video + 延长意图 | ratio=adaptive |
编辑、延长、首帧、首尾帧对 ratio、duration 有硬限制;建议显式设置 omni_reference_task_type。
| 值 | 说明 |
|---|---|
auto | 由模型根据提示词判断任务类型 |
reference | 全模态参考 |
edit | 视频编辑 |
extend | 视频延长 |
5. 素材规则
| 类型 | 格式 | 数量 / 时长 | 大小 |
|---|---|---|---|
| 图 | jpeg / png / webp / bmp / tiff / gif / heic / heif | ≤30;宽高 300~6000;宽高比 0.4~2.5 | 单张 <30MB |
| 视频 | mp4 / mov(H.264 / H.265) | ≤10;单段 2~30s(编辑 4~30s);总时长 ≤30s | 单文件 ≤200MB |
| 音频 | wav / mp3 | ≤10;单段 2~30s;总时长 ≤30s | 单段 ≤15MB |
媒体可用公网 HTTPS URL、data:*;base64,...(整包建议 ≤64MB)或素材库 asset://{AssetId}。含未授权真人人脸的参考图/视频不可直接使用。大文件优先使用公网 URL。
6. 文生视频
curl -X POST "__apiBaseUrl__/api/v3/contents/generations/tasks" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance2.5-huoshan",
"content": [
{"type": "text", "text": "清晨森林,镜头平稳推进,电影质感"}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true
}'提交成功:
{"id": "cgt-20260414114820-xxxxx"}7. 首尾帧
{
"model": "seedance2.5-huoshan",
"content": [
{"type": "text", "text": "从首帧自然过渡到尾帧"},
{"type": "image_url", "image_url": {"url": "https://example.com/first.png"}, "role": "first_frame"},
{"type": "image_url", "image_url": {"url": "https://example.com/last.png"}, "role": "last_frame"}
],
"resolution": "720p",
"ratio": "adaptive",
"duration": 5
}8. 全模态参考
{
"model": "seedance2.5-huoshan",
"content": [
{"type": "text", "text": "保持人物与服装一致,缓慢回头,参考@Image1 与@Video1"},
{"type": "image_url", "image_url": {"url": "https://example.com/ref.png"}, "role": "reference_image"},
{"type": "video_url", "video_url": {"url": "https://example.com/ref.mp4"}, "role": "reference_video"},
{"type": "audio_url", "audio_url": {"url": "https://example.com/ref.mp3"}, "role": "reference_audio"}
],
"resolution": "720p",
"ratio": "adaptive",
"duration": -1,
"omni_reference_task_type": "auto",
"generate_audio": true
}无声视频必须显式传 "generate_audio": false。
draft=true 仅支持 480p。基于样片生成正式片时,在 content[] 中增加 draft_task,并填写样片任务的 draft_task.id。
9. 任务查询
curl -X GET "__apiBaseUrl__/api/v3/contents/generations/tasks/cgt-20260414114820-xxxxx" \
-H "Authorization: Bearer <YOUR_API_KEY>"建议间隔 5~10 秒轮询。成片 URL 成功后尽快转存(通常约 24 小时有效)。
9.1 status
status | 含义 |
|---|---|
queued | 排队 |
running | 生成中 |
succeeded | 成功,读 content.video_url |
failed | 失败,读 error |
expired | 超时 |
9.2 成功示例
{
"id": "cgt-20260414114820-xxxxx",
"model": "seedance2.5-huoshan",
"status": "succeeded",
"content": {"video_url": "https://cdn.example.com/out.mp4"},
"resolution": "720p",
"duration": 5,
"ratio": "16:9",
"generate_audio": true,
"usage": {"completion_tokens": 411300, "total_tokens": 411300},
"created_at": 1776138520,
"updated_at": 1776139219
}9.3 失败示例
{
"id": "cgt-xxxx",
"status": "failed",
"error": {"code": "InvalidParameter.TaskTypeConstraint", "message": "..."}
}10. 错误处理
HTTP
| HTTP | 说明 |
|---|---|
400 | 参数错误、场景混用、任务类型约束不满足 |
401 | 令牌无效或缺失 |
402 | 余额不足 |
403 | 无权使用模型 / 令牌禁用 |
429 | 限流 |
500 | 服务端错误 |
同步错误体示例:
{
"code": "invalid_request",
"message": "ratio must be adaptive for first_frame / last_frame",
"data": null
}任务失败常见码
| code | 说明 |
|---|---|
InvalidParameter | 参数非法 |
InvalidParameter.TaskTypeConstraint | 参数与实际任务类型不兼容(多为异步) |
InvalidParameter.TaskTypeMismatch | omni_reference_task_type 与提示词判定不一致 |
InputImageSensitiveContentDetected 等 | 输入审核未通过 |
OutputVideoSensitiveContentDetected 等 | 输出审核未通过 |
11. 素材库引用
content[] 里的媒体 URL 可以换成素材库地址 asset://{AssetId}。素材须为 Active,且属于当前 API Key 所属账号。
| 素材类型 | content type | 字段路径 |
|---|---|---|
| 图片 | image_url | image_url.url |
| 视频 | video_url | video_url.url |
| 音频 | audio_url | audio_url.url |
上传与查询见 素材库 API(用户)、素材库 API(中转站接入)。
12. 注意事项
- 创建与查询均走
/api/v3/contents/generations/tasks,model固定seedance2.5-huoshan。 - 请求体按火山方舟 Contents 协议原样提交,不要改成
prompt+images简化字段。 - 编辑、延长、首帧、首尾帧对
ratio、duration有硬限制;建议显式设置omni_reference_task_type。 - 无声视频必须显式传
"generate_audio": false。 - 轮询建议 5~10 秒一次;成片 URL 成功后尽快转存。
- 大文件优先公网 URL;整包请求体建议 ≤64MB。
- 勿直接上传含未授权真人人脸的参考图/视频。
draft=true仅支持480p;正式片用draft_task.id二次创建。1080p可能为 10bit + H.265,部分播放器需兼容处理。
13. 快速对照表
| 场景 | content 关键项 | 关键顶层参数 |
|---|---|---|
| 文生视频 | text | resolution / ratio / duration |
| 首帧 | text + first_frame | ratio=adaptive |
| 首尾帧 | text + first_frame + last_frame | ratio=adaptive |
| 全模态参考 | text + reference_image / reference_video / reference_audio | 可设 omni_reference_task_type |
| 视频编辑 | reference_video + 编辑意图 | ratio=adaptive,duration=-1 |
| 视频延长 | reference_video + 延长意图 | ratio=adaptive |
| 无声成片 | 按场景填写 | generate_audio=false |
| 样片 | 按场景填写 | draft=true,仅 480p |
| 样片转正式 | draft_task.id | 二次创建 |
| 素材库 | url 使用 asset://... | 素材状态为 Active |
这篇文档对您有帮助吗?