> ## 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.

# 图生视频-base64编码

> 图生视频。基于单张参考图片和文本提示词生成视频。支持 base64 编码格式。支持全部 4 个模型。提交异步任务后返回 id，需通过查询接口获取结果。

这是 **Seedance 视频生成 API** 的图生视频接口。基于单张参考图片和文本提示词生成视频。支持 base64 编码格式。提交异步任务后返回 id，需通过查询接口获取结果。

**使用方式**：在 `content` 中包含 `text`（提示词）和 `image_url`（参考图片，无 role 字段，支持 base64 编码）。`ratio` 为 `adaptive` 自动保持和参考图片一致。


## OpenAPI

````yaml openapi/cn/seedance-image-to-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: >-
        图生视频。基于单张参考图片和文本提示词生成视频。支持 base64 编码格式。支持全部 4 个模型。提交异步任务后返回
        id，需通过查询接口获取结果。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRequest'
            example:
              model: doubao-seedance-2-0-260128
              content:
                - type: text
                  text: 一个女孩在海边散步，微风吹拂她的头发
                - type: image_url
                  image_url:
                    url: data:image/png;base64,aHR0cHM6Ly9leGFtcGxlLmNvbS9yZWYucG5n
              ratio: adaptive
              duration: 10
              generate_audio: true
              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 和 image_url（无 role 字段，支持 base64 编码）
        resolution:
          type: string
          enum:
            - 480p
            - 720p
            - 1080p
            - 4k
          default: 720p
          description: >-
            视频分辨率。Seedance 2.0 可选：480p、720p、1080p、4k，默认 720p；2.0 fast/mini
            可选：480p、720p
        ratio:
          type: string
          enum:
            - adaptive
          description: 视频宽高比，adaptive 自动保持和参考图片一致
        duration:
          type: integer
          default: -1
          description: 视频时长（秒）。范围 [4, 15] 或 -1（智能选择）。Seedance 2.0 fast/mini 范围 [4, 15]
        generate_audio:
          type: boolean
          default: true
          description: 是否生成同步音频
        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
    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:
                - image_url
            image_url:
              type: object
              properties:
                url:
                  type: string
                  description: >-
                    参考图片 URL /
                    Base64。格式：jpeg/png/webp/bmp/tiff/gif/heic/heif，宽高比 [0.4,
                    2.5]，大小 < 30MB
            role:
              type: string
              enum:
                - first_frame
              description: 图片用途。图生视频场景 role 为 first_frame 或不填
          required:
            - type
            - image_url
  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.