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

# Audio Video - First & Last Frame

> Audio video - first & last frame. Generate video with synchronized audio based on first and last frame images.only Seedance 2.0 seriessupported. All 4 models supported. Submit async task andreturn id, use query endpoint to get results.

This is the **Seedance Video Generation API** audio video - first & last frame endpoint. Generate video with synchronized audio based on first and last frame images. All 4 models supported. Submit async task and return id, use query endpoint to get results.

**Usage**: Include text (prompt) and two image\_url (role=first\_frame first frame, role=last\_frame last frame) in content, set generate\_audio: true. ratio is adaptive to automatically match first frame image.


## OpenAPI

````yaml openapi/en/seedance-audio-first-last-frame.json POST /sd/api/v3/contents/generations/tasks
openapi: 3.1.0
info:
  title: Seedance Video Generation API (Audio Video - First & Last Frame)
  version: 1.0.0
  description: Generate audio video from first and last frame images.
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /sd/api/v3/contents/generations/tasks:
    post:
      description: >-
        Audio video - first & last frame. Generate video with synchronized audio
        based on first and last frame images.only Seedance 2.0 seriessupported.
        All 4 models supported. Submit async task andreturn id, use query
        endpoint to get results.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRequest'
            example:
              model: doubao-seedance-2-0-260128
              content:
                - type: text
                  text: A girl walking on the beach
                - type: image_url
                  image_url:
                    url: https://example.com/first.jpg
                  role: first_frame
                - type: image_url
                  image_url:
                    url: https://example.com/last.jpg
                  role: last_frame
              ratio: '16:9'
              duration: 10
              generate_audio: true
              watermark: true
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Task 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: Model ID
        content:
          type: array
          items:
            $ref: '#/components/schemas/ContentItem'
          description: >-
            Input content list. Must include 2 image_url items (role:
            first_frame and last_frame), optional text and audio_url
        resolution:
          type: string
          enum:
            - 480p
            - 720p
            - 1080p
            - 4k
          default: 720p
          description: >-
            Video resolution. Seedance 2.0 options: 480p, 720p, 1080p, 4k.
            Default 720p
        ratio:
          type: string
          enum:
            - adaptive
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
            - '21:9'
          default: adaptive
          description: >-
            Video aspect ratio. Default adaptive (auto), or specify a specific
            ratio
        duration:
          type: integer
          default: -1
          description: Video duration (seconds). Range [4, 15] or -1 (smart selection)
        generate_audio:
          type: boolean
          default: true
          description: Whether to generate synchronized audio
        watermark:
          type: boolean
          default: false
          description: Whether to add watermark
        return_last_frame:
          type: boolean
          default: false
          description: Whether to return last frame image
        callback_url:
          type: string
          description: Callback URL
        execution_expires_after:
          type: integer
          default: 172800
          description: Task timeout threshold (seconds). Range [3600, 259200]
        priority:
          type: integer
          default: 0
          description: Execution priority. Range [0, 9]
        safety_identifier:
          type: string
          description: End user identifier, max 64 characters
        tools:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - web_search
          description: Tool configuration
        service_tier:
          type: string
          enum:
            - default
          default: default
          description: Service tier
      required:
        - model
        - content
    ContentItem:
      type: object
      description: Input content item
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - text
            text:
              type: string
              description: Text prompt
          required:
            - type
            - text
        - type: object
          properties:
            type:
              type: string
              enum:
                - image_url
            image_url:
              type: object
              properties:
                url:
                  type: string
                  description: >-
                    Image URL / Base64。Format:
                    jpeg/png/webp/bmp/tiff/gif/heic/heif，size < 30MB
            role:
              type: string
              enum:
                - first_frame
                - last_frame
              description: 'Image purpose: first_frame=first frame, last_frame=last frame'
          required:
            - type
            - image_url
            - role
        - type: object
          properties:
            type:
              type: string
              enum:
                - audio_url
            audio_url:
              type: object
              properties:
                url:
                  type: string
                  description: >-
                    Audio URL / Base64 / Asset ID. Format: wav/mp3, duration [2,
                    15]s, size ≤ 15MB
            role:
              type: string
              enum:
                - reference_audio
              description: Fixed as reference_audio
          required:
            - type
            - audio_url
            - role
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        Get your API key from the <a href='https://dashboard.ttapi.io'
        target='_blank'>TTAPI Dashboard</a>.

````

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