> ## 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** 的文生视频接口。仅通过文本提示词生成视频，不传入任何媒体文件。提交异步任务后返回 id，需通过查询接口获取结果。

**使用方式**：在 content 中仅包含 text（提示词）。ratio 可指定具体值如 16:9。


## OpenAPI

````yaml openapi/cn/seedance-text-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: 文生视频。仅通过文本提示词生成视频，不传入任何媒体文件。支持全部 4 个模型。提交异步任务后返回 id，需通过查询接口获取结果。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRequest'
            example:
              model: doubao-seedance-2-0-260128
              content:
                - type: text
                  text: 一个女孩在海边散步，微风吹拂她的头发，阳光洒在海面上
              ratio: '16:9'
              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
        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:
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
            - '21:9'
          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: 文本提示词，描述期望生成的视频内容。中文不超过 500 字，英文不超过 1000 词
          required:
            - type
            - text
  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.