> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# seedance-2.5 视频生成

> 使用 seedance-2-5 模型生成视频

> [!NOTE]
>
> **国内用户请注意：** 中国大陆用户请使用 `https://toapis.cn` 作为接口地址（Base URL）。文档示例中的 `https://toapis.com` 请替换为 `https://toapis.cn`。

Seedance 2.5 的公共模型名为 `seedance-2-5`，火山引擎上游模型 ID 为 `doubao-seedance-2-5-260628`。

* 支持文生视频、首帧/首尾帧图生视频、视频编辑、视频延长和多模态参考生视频。
* 支持图片、视频、音频参考，也支持纯音频参考。
* 接口为异步任务：提交后返回 `generation.task`，完成后通过任务状态接口获取视频。

样片模式可以先低成本生成 480p 样片，再用该样片生成 1080p 成稿，详见[样片模式](https://docs.toapis.com/docs/cn/api-reference/videos/seedance-2-5/draft.md)。

## Authorizations

**Authorization** `string` *required*

所有请求都需要 Bearer Token。请在 [API Key 管理页面](https://toapis.com/console/token) 获取密钥，并在请求头中添加：

```
Authorization: Bearer YOUR_API_KEY
```

## Body

**model** `string` *required* (default: seedance-2-5)

ToAPIs 公共模型名，固定使用 `seedance-2-5`。

**prompt** `string`

描述场景、镜头运动、主体动作、风格和声音氛围。引用素材时使用“图片1”“视频1”“音频1”等标签。

**video\_operation** `string` (default: generate)

视频业务类型，可选 `generate`、`edit` 或 `extend`。编辑和延长至少需要一个 `video_with_roles`；编辑使用 `duration=-1`，延长使用 `4`–`30` 或 `-1`。三种操作共用本接口。

**client\_business\_id** `string`

客户侧订单号或业务任务 ID。提交后会随任务保存，也可用 `GET /v1/videos/generations/{client_business_id}` 查询。

**duration** `integer`

输出视频时长（秒），范围为 `4`–`30`；`-1` 表示由模型自动选择时长。编辑任务只能使用 `-1`，输出时长与输入视频基本一致；延长任务可使用 `4`–`30` 或 `-1`，此时按延长后的输出总时长计算。

**aspect\_ratio** `string`

可选：`21:9`、`16:9`、`4:3`、`1:1`、`3:4`、`9:16`、`adaptive`。

编辑、视频延长和首尾帧任务按上游要求使用 `adaptive`；也可让输入素材决定比例。

**image\_urls** `string[]`

兼容模式的图片 URL 数组。新接入建议使用 `image_with_roles` 明确每张图的用途；两个字段不能同时传。

**image\_with\_roles** `array`

带角色的图片数组，每项包含必填 `url` 和 `role`。角色可为 `first_frame`、`last_frame` 或 `reference_image`。最多 30 张图片；首尾帧模式与参考图模式不能混用。

**video\_with\_roles** `array`

参考视频数组，每项包含必填 `url`，角色固定为 `reference_video`。最多 10 段视频。

**audio\_with\_roles** `array`

参考音频数组，每项包含必填 `url`，角色固定为 `reference_audio`。最多 10 段音频，也支持纯音频参考。

**resolution** `string`

分辨率：`480p`、`720p` 或 `1080p`。

**output\_format** `string` (default: mp4)

支持 `mp4` 和 `mov`。

**generate\_audio** `boolean` (default: true)

是否生成同步音频。

**return\_last\_frame** `boolean` (default: false)

是否在完成结果中返回生成视频的尾帧图片。

**tools** `array`

可选工具：`[{ "type": "web_search" }]`。仅适用于纯文生视频，不能与图片、视频或音频输入同时使用。

**callback\_url** `string`

ToAPIs 任务完成回调地址，详见[任务 Webhook](https://docs.toapis.com/docs/cn/api-reference/webhooks/task-webhooks.md)。

**trace\_id** `string`

调用方自定义的链路追踪 ID。

**disable\_nsfw** `boolean` (default: false)

设为 `true` 时禁止生成 NSFW 内容。

## 参考素材限制

总计最多 50 个参考素材：图片 30 张、视频 10 段、音频 10 段。请使用显式角色，避免首帧/尾帧与参考素材被错误推断。

> [!WARNING]
>
> 非法任务组合可能失败。编辑和延长任务会显式指定上游任务类型，特殊限制不符合时在提交阶段立即返回错误；其余任务类型由模型按素材和提示词判断，不符合时在异步阶段失败并返回 `InvalidParameter.TaskTypeConstraint`。编辑、延长和首尾帧任务按上游要求将 `aspect_ratio` 设为 `adaptive`。

## 素材审核

请求带图片, 视频或音频素材时, 部分渠道会在提交生成前自动审核素材. 无需额外参数, 在原有媒体字段中传入素材 URL 即可.

* 请求受理后立即返回视频任务. 需要审核时任务保持 `queued`, 本次请求的素材全部通过后才提交生成. 首次审核可能需要数分钟, 同一用户在同一渠道重复使用相同 URL 时会复用审核结果.
* 每轮素材准备默认最长 20 分钟. 素材被拒绝或准备超时会结束任务, 状态为 `failed`, 原因见 `error.message`. 审核未通过不收取视频生成费用.
* 素材须为公网 HTTP(S) URL, 不接受 Base64 和本地路径. 图片建议不超过 20 MB (部分渠道最高 30 MB), 视频和音频不超过 100 MiB; 各模型原有的格式限制不变.
* 需要审核的渠道会在受理时校验素材: URL 带账号密码或超过 2048 字节, 同一 URL 被用作不同类型, 或单次请求的素材引用超过 64 个时, 直接返回 HTTP 400, `error.code` 为 `invalid_private_assets`.
* 平台按 URL 识别素材. 文件内容变化后请换用新的 URL.
* 成稿请求 (`draft_task_id`) 不送审.
* 旧的 `asset://` 素材引用已停用, 会返回 HTTP 400.

> [!NOTE]
>
> 完成后通过[视频任务查询](https://docs.toapis.com/docs/cn/api-reference/tasks/video-status.md#seedance-原始地址与备用地址)获取结果. 启用原始地址交付时优先使用 `result.data[].url`; 主地址无法访问时, 再使用可选的 `fallback_url`. 尾帧对应 `last_frame_url` 和 `fallback_last_frame_url`, 备用字段仅在副本可用时返回.

## Response

**id** `string`

任务 ID，用于查询状态。

**client\_business\_id** `string`

请求传入该字段时返回。

**object** `string`

固定为 `generation.task`。

**model** `string`

本次请求的模型名。

**status** `string`

`queued`、`in_progress`、`completed` 或 `failed`。

**progress** `integer`

`0`–`100` 的任务进度。

**created\_at** `integer`

创建时间戳。

```bash cURL theme={null}
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "seedance-2-5",
    "prompt": "电影感产品特写，镜头缓慢推进，保留自然室内声音。",
    "duration": 10,
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "generate_audio": true
  }'
```

```json 多模态参考请求 theme={null}
{
  "model": "seedance-2-5",
  "prompt": "使用图片1中的人物、视频1的运镜和音频1的节奏。",
  "duration": 12,
  "aspect_ratio": "16:9",
  "image_with_roles": [{"url": "https://example.com/ref.png", "role": "reference_image"}],
  "video_with_roles": [{"url": "https://example.com/motion.mp4", "role": "reference_video"}],
  "audio_with_roles": [{"url": "https://example.com/rhythm.mp3", "role": "reference_audio"}]
}
```

```json 视频延长请求 theme={null}
{
  "model": "seedance-2-5",
  "prompt": "向后延长视频1，镜头继续推进并展示窗外的城市。",
  "video_operation": "extend",
  "duration": 11,
  "aspect_ratio": "adaptive",
  "output_format": "mov",
  "video_with_roles": [{"url": "https://example.com/source.mov", "role": "reference_video"}]
}
```

```json 200 theme={null}
{
  "id": "tsk_vid_xxx",
  "object": "generation.task",
  "model": "seedance-2-5",
  "status": "in_progress",
  "progress": 10,
  "created_at": 1781577600
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.