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

# Seedance 2.5 视频生成

> seedance-2.5 的生成请求与响应。

## 模型选择

| 模型 ID | 请求地址 |
| - | - |
| `seedance-2.5` | `POST /v1/videos` |

## 主要参数

下表列出常用参数；媒体引用的组合限制以接口校验结果为准。

| 字段 | 取值或限制 | 说明 |
| - | - | - |
| `model` | `seedance-2.5` | 模型 ID |
| `prompt` | string | 内容描述；最多 4000 字符，使用素材时可选 |
| `duration` | `-1`、4–30；默认 `5` | 普通生成 4–30 秒；编辑参考视频时设为 -1，由上游按素材决定输出时长 |
| `size` | `adaptive`、`16:9`、`4:3`、`1:1`、`3:4`、`9:16`、`21:9` | 视频宽高比；部分参考素材或编辑模式有额外限制 |
| `resolution` | `480p`、`720p`、`1080p`；默认 `720p` | 输出分辨率；draft 为 true 时必须使用 480p |
| `image_urls` | 最多 30 项 | 普通参考图；首尾帧请使用 image\_with\_roles |
| `image_with_roles` | 最多 30 项 | 带角色的参考图；不能与 image\_urls 同时传入 |
| `video_urls` | 最多 10 项 | 参考视频地址；实际时长与格式还需符合模型的素材限制 |
| `audio_urls` | 最多 10 项 | 参考音频地址；实际时长与格式还需符合模型的素材限制 |
| `seed` | integer | 随机种子 |
| `generate_audio` | `true` / `false`；默认 `false` | 是否生成配套音频 |
| `return_last_frame` | `true` / `false`；默认 `false` | 请求生成尾帧；当前网关任务结果只提供主视频文件，不公开尾帧 |
| `tools` | array | 可选联网搜索工具，如 `[{"type":"web_search"}]` |
| `nsfw_check` | `true` / `false`；默认 `false` | 提交前审核提示词与图片；审核服务异常时请求仍可能继续提交 |
| `draft` | `true` / `false`；默认 `false` | 生成 480p 样片；必须使用 480p 分辨率 |
| `watermark` | `true` / `false`；默认 `false` | 添加 AI 生成水印 |
| `output_format` | `mp4`、`mov`；默认 `mp4` | 视频封装格式 |
| `omni_reference_task_type` | `auto`、`reference`、`extend`、`edit`；默认 `auto` | 参考生成、延长或编辑；edit 需带参考视频、size=adaptive、duration=-1（也可省略 duration） |

## 素材规则

`image_urls` 与带 `url` / `role` 的 `image_with_roles` 不能同时提供。首尾帧与视频或音频参考素材的组合需遵守模型限制。
参考视频与音频的时长、格式及总时长需符合当前模型的限制。

## 编辑参考视频

编辑模式需要 `video_urls`、`size: "adaptive"`、`duration: -1`，建议明确设置 `omni_reference_task_type: "edit"`。编辑时输出时长取决于被选中的参考视频（须为 4–30 秒），不是固定的请求秒数。正常的参考生成仍使用 4–30 秒，并可设置 `omni_reference_task_type: "reference"`；`auto` 模式仍可能因提示词被上游判定为编辑。

```json theme={null}
{"model":"seedance-2.5","prompt":"调整视频中的光线","video_urls":["https://example.com/input.mp4"],"size":"adaptive","duration":-1,"omni_reference_task_type":"edit"}
```

样片模式可生成 480p 视频，但当前网关任务查询不会返回上游任务 ID，因此无法直接使用 `draft_task_id` 在本网关续生成正式片。

## 返回说明

提交后返回任务 ID，不表示视频已经完成。请在 [任务查询](/videos/task) 中用同一用户的密钥查询状态和结果。


## OpenAPI

````yaml generated/seedance-2.5.json POST /v1/videos
openapi: 3.0.3
info:
  title: new-api Seedance 2.5 API
  version: 0.1.0
servers:
  - url: https://ai.xbrod.com
    description: 本项目线上 API 网关
security:
  - bearerAuth: []
paths:
  /v1/videos:
    post:
      summary: Seedance 2.5 视频生成
      description: 使用当前模型发起生成请求。
      operationId: generate_seedance_2_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - seedance-2.5
                  description: 模型 ID
                prompt:
                  type: string
                  description: 内容描述；最多 4000 字符，使用素材时可选
                duration:
                  oneOf:
                    - type: integer
                      enum:
                        - -1
                    - type: integer
                      minimum: 4
                      maximum: 30
                  default: 5
                  description: 普通生成 4–30 秒；编辑参考视频时设为 -1，由上游按素材决定输出时长
                size:
                  type: string
                  enum:
                    - adaptive
                    - '16:9'
                    - '4:3'
                    - '1:1'
                    - '3:4'
                    - '9:16'
                    - '21:9'
                  description: 视频宽高比；部分参考素材或编辑模式有额外限制
                resolution:
                  type: string
                  enum:
                    - 480p
                    - 720p
                    - 1080p
                  default: 720p
                  description: 输出分辨率；draft 为 true 时必须使用 480p
                image_urls:
                  type: array
                  maxItems: 30
                  items:
                    type: string
                  description: 普通参考图；首尾帧请使用 image_with_roles
                image_with_roles:
                  type: array
                  maxItems: 30
                  description: 带角色的参考图；不能与 image_urls 同时传入
                  items:
                    type: object
                    required:
                      - url
                      - role
                    properties:
                      url:
                        type: string
                      role:
                        type: string
                        enum:
                          - first_frame
                          - last_frame
                          - reference_image
                video_urls:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                  description: 参考视频地址；实际时长与格式还需符合模型的素材限制
                audio_urls:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                  description: 参考音频地址；实际时长与格式还需符合模型的素材限制
                seed:
                  type: integer
                  description: 随机种子
                generate_audio:
                  type: boolean
                  default: false
                  description: 是否生成配套音频
                return_last_frame:
                  type: boolean
                  default: false
                  description: 请求生成尾帧；当前网关任务结果只提供主视频文件，不公开尾帧
                tools:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - web_search
                  description: 可选联网搜索工具，如 `[{"type":"web_search"}]`
                nsfw_check:
                  type: boolean
                  default: false
                  description: 提交前审核提示词与图片；审核服务异常时请求仍可能继续提交
                draft:
                  type: boolean
                  default: false
                  description: 生成 480p 样片；必须使用 480p 分辨率
                watermark:
                  type: boolean
                  default: false
                  description: 添加 AI 生成水印
                output_format:
                  type: string
                  enum:
                    - mp4
                    - mov
                  default: mp4
                  description: 视频封装格式
                omni_reference_task_type:
                  type: string
                  enum:
                    - auto
                    - reference
                    - extend
                    - edit
                  default: auto
                  description: >-
                    参考生成、延长或编辑；edit 需带参考视频、size=adaptive、duration=-1（也可省略
                    duration）
              required:
                - model
            example:
              model: seedance-2.5
              prompt: 湖面上的纸船，日出时的柔和光线
              size: '16:9'
              duration: 5
              resolution: 720p
      responses:
        '200':
          description: 任务已提交，视频文件尚未生成
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  object:
                    type: string
                  status:
                    type: string
                  model:
                    type: string
              example:
                id: task_example
                object: video
                status: queued
                model: seedance-2.5
        '400':
          description: 模型未启用、缺少提示词或媒体引用，或参数超出模型限制
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 本项目签发的 API 密钥，不是上游密钥

````

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