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

> ## Agent Instructions
> Send API requests to https://api.ttapi.io with the TT-API-KEY header. Midjourney account hosting uses https://hold.ttapi.io. Claude Code uses https://cc.ttapi.io.
> Most generation endpoints are asynchronous. The submit response returns a job id. Poll that product's fetch endpoint, or pass a webhook on the submit request. A fetch call does not start a new generation.
> 1 USD = 100 quota. Check the pricing page for that product before estimating cost.
> This file lists the English docs. Follow every /_llms/ link recursively for the API reference, Chinese, and Russian. Open a page's .md URL for the endpoint schema.

# 编辑视频

> 编辑视频。基于参考视频进行编辑，支持删除、替换、修改等操作。支持全部 4 个模型。提交异步任务后返回 id，需通过查询接口获取结果。

这是 **Seedance 视频生成 API** 的编辑视频接口。基于参考视频进行编辑，支持删除、替换、修改等操作。支持全部 4 个模型。提交异步任务后返回 id，需通过查询接口获取结果。

**使用方式**：在 content 中包含 text（编辑指令）和 video\_url（role=reference\_video，待编辑视频），设置 omni\_reference\_task\_type: "edit"。ratio 必须为 adaptive，duration 必须为 -1。


## OpenAPI

````yaml openapi/cn/seedance-edit-video.json POST /sd/api/v3/contents/generations/tasks
openapi: 3.1.0
info:
  title: Seedance 视频生成 API（编辑视频）
  version: 1.0.0
  description: 基于参考视频进行编辑生成新视频。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /sd/api/v3/contents/generations/tasks:
    post:
      description: 编辑视频。基于参考视频进行编辑，支持删除、替换、修改等操作。支持全部 4 个模型。提交异步任务后返回 id，需通过查询接口获取结果。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRequest'
            example:
              model: doubao-seedance-2-5-260628
              content:
                - type: text
                  text: 删除视频中的所有人，除了主角
                - type: video_url
                  video_url:
                    url: https://example.com/input.mov
                  role: reference_video
              omni_reference_task_type: edit
              ratio: adaptive
              duration: -1
              generate_audio: true
              output_format: mov
              watermark: true
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: 任务 ID
                example:
                  id: cgt-20261021120000-xxxxx
                required:
                  - id
      security:
        - CustomApiKey: []
components:
  schemas:
    CreateRequest:
      type: object
      properties:
        model:
          type: string
          enum:
            - doubao-seedance-2-5-260628
            - doubao-seedance-2-0-260128
            - doubao-seedance-2-0-fast-260128
            - doubao-seedance-2-0-mini-260615
          description: 模型 ID
        content:
          type: array
          items:
            $ref: '#/components/schemas/ContentItem'
          description: 输入内容列表。必须包含 text（编辑指令）和至少一个 video_url（reference_video）
        omni_reference_task_type:
          type: string
          enum:
            - edit
          description: 任务类型，固定为 edit（视频编辑）
        ratio:
          type: string
          enum:
            - adaptive
          description: 视频宽高比，必须为 adaptive（自动保持与待编辑视频一致）
        duration:
          type: integer
          enum:
            - -1
          description: 视频时长，必须为 -1（模型自动保持与待编辑视频基本一致，误差约 0.4 秒）
        generate_audio:
          type: boolean
          default: true
          description: 是否生成同步音频
        output_format:
          type: string
          enum:
            - mp4
            - mov
          default: mp4
          description: 输出格式。mov 推荐用于视频编辑场景（高色彩精度）
        watermark:
          type: boolean
          default: false
          description: 是否添加水印
        return_last_frame:
          type: boolean
          default: false
          description: 是否返回尾帧图像
        callback_url:
          type: string
          description: 回调地址
        execution_expires_after:
          type: integer
          default: 172800
          description: 任务超时阈值（秒）。范围 [3600, 259200]
        priority:
          type: integer
          default: 0
          description: 执行优先级。范围 [0, 9]
        safety_identifier:
          type: string
          description: 终端用户标识，不超过 64 字符
        tools:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - web_search
          description: 工具配置
        service_tier:
          type: string
          enum:
            - default
          default: default
          description: 服务等级
      required:
        - model
        - content
        - omni_reference_task_type
        - ratio
        - duration
    ContentItem:
      type: object
      description: 输入内容项
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - text
            text:
              type: string
              description: 编辑指令
          required:
            - type
            - text
        - type: object
          properties:
            type:
              type: string
              enum:
                - video_url
            video_url:
              type: object
              properties:
                url:
                  type: string
                  description: 待编辑视频 URL。格式：mp4/mov，时长 [4, 30]s，大小 ≤ 200MB
            role:
              type: string
              enum:
                - reference_video
              description: 固定为 reference_video
          required:
            - type
            - video_url
            - role
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````

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