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

# Create video task

> Creates a video generation task asynchronously and returns its `id`. Poll Get task for the result, or pass `callback_url` to receive a callback. A request that fails validation creates no task and is not billed.



## OpenAPI

````yaml /openapi/en/seedance-2-5-flash.json post /api/v3/contents/generations/tasks
openapi: 3.1.0
info:
  description: >-
    DreamTo Open Platform API. Generated from the Gateway source
    (apps/gateway/internal/service/seedance_v3_contract.go); do not edit by
    hand.
  title: Seedance 2.5 Flash · DreamTo Open Platform API
  version: v3
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Seedance 2 video generation
paths:
  /api/v3/contents/generations/tasks:
    post:
      tags:
        - Seedance 2 video generation
      summary: Create video task
      description: >-
        Creates a video generation task asynchronously and returns its `id`.
        Poll Get task for the result, or pass `callback_url` to receive a
        callback. A request that fails validation creates no task and is not
        billed.
      operationId: seedanceCreateTask
      requestBody:
        content:
          application/json:
            examples:
              Text to video:
                description: Generate a video from a text prompt only.
                summary: Text to video
                value:
                  model: seedance-2.5-flash
                  content:
                    - type: text
                      text: >-
                        Photorealistic. Under a clear blue sky, a vast field of
                        white daisies; the camera slowly pushes in and settles
                        on a close-up of a single daisy with a few glistening
                        dewdrops on its petals
                  ratio: '16:9'
                  duration: 5
                  resolution: 720p
                  generate_audio: true
              Image to video (first frame):
                description: Animate an image used as the first frame.
                summary: Image to video (first frame)
                value:
                  model: seedance-2.5-flash
                  content:
                    - type: text
                      text: >-
                        Slow push-in, the person smiles, hair gently moving in
                        the breeze, cinematic lighting
                    - type: image_url
                      image_url:
                        url: https://example.com/portrait.jpg
                      role: first_frame
                  duration: 5
                  resolution: 720p
              First and last frame:
                description: Generate the transition between a first and a last frame.
                summary: First and last frame
                value:
                  model: seedance-2.5-flash
                  content:
                    - type: text
                      text: >-
                        Smoothly transition from the first image to the second,
                        steady push-in, soft light, cinematic transition
                    - type: image_url
                      image_url:
                        url: https://example.com/frame_start.jpg
                      role: first_frame
                    - type: image_url
                      image_url:
                        url: https://example.com/frame_end.jpg
                      role: last_frame
                  duration: 5
                  resolution: 720p
              Multi-image reference:
                description: >-
                  Combine characters, objects and scenes from several reference
                  images.
                summary: Multi-image reference
                value:
                  model: seedance-2.5-flash
                  content:
                    - type: text
                      text: >-
                        The boy with glasses in a blue T-shirt from [image 1]
                        and the corgi from [image 2] sit on the lawn from [image
                        3], cartoon style
                    - type: image_url
                      image_url:
                        url: https://example.com/boy.png
                      role: reference_image
                    - type: image_url
                      image_url:
                        url: https://example.com/dog.png
                      role: reference_image
                    - type: image_url
                      image_url:
                        url: https://example.com/grass.png
                      role: reference_image
                  ratio: '16:9'
                  duration: 5
                  resolution: 720p
              Video editing:
                description: Modify the content of a reference video.
                summary: Video editing
                value:
                  model: seedance-2.5-flash
                  content:
                    - type: text
                      text: >-
                        Paint the exterior walls of the house in video 1 blue
                        and change the weather to snow
                    - type: video_url
                      video_url:
                        url: https://example.com/house.mp4
                      role: reference_video
                  ratio: adaptive
                  duration: -1
                  resolution: 720p
                  omni_reference_task_type: edit
              Video extension:
                description: Continue a reference video with new footage.
                summary: Video extension
                value:
                  model: seedance-2.5-flash
                  content:
                    - type: text
                      text: >-
                        Keep the original camera move; the person keeps walking
                        out of frame to the right as the light turns to dusk
                    - type: video_url
                      video_url:
                        url: https://example.com/clip.mp4
                      role: reference_video
                  ratio: adaptive
                  duration: 5
                  resolution: 720p
                  omni_reference_task_type: extend
              Reference audio:
                description: Match the rhythm and mood of a reference audio.
                summary: Reference audio
                value:
                  model: seedance-2.5-flash
                  content:
                    - type: text
                      text: >-
                        The dancer from [image 1] dances on a neon street, moves
                        synced to the beat of audio 1, fast cuts
                    - type: image_url
                      image_url:
                        url: https://example.com/dancer.png
                      role: reference_image
                    - type: audio_url
                      audio_url:
                        url: https://example.com/beat.mp3
                      role: reference_audio
                  ratio: '9:16'
                  duration: 8
                  resolution: 720p
              Web search:
                description: Let the model use real-time information.
                summary: Web search
                value:
                  model: seedance-2.5-flash
                  content:
                    - type: text
                      text: >-
                        Make a short video introducing the most popular travel
                        destination right now
                  ratio: '16:9'
                  duration: 5
                  resolution: 720p
                  tools:
                    - type: web_search
            schema:
              $ref: '#/components/schemas/SeedanceV3CreateTaskRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                example:
                  value:
                    id: task_8c1d2e3f4a5b6c7d8e9f0a1b
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3CreateTaskResponse'
          description: Success
          headers:
            X-Request-Id:
              description: >-
                Unique ID of this request (prefixed with `req_`). Present on
                every response, success or failure; include it and the task `id`
                when contacting support.
              schema:
                type: string
        '400':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: invalid_parameter
                      message: >-
                        duration must be an integer from 4 to 30 seconds, or -1
                        (smart duration)
                      type: invalid_request_error
                      http_status: 400
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      param: duration
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: >-
            Bad request: `invalid_parameter` (`error.param` names the field) or
            `invalid_request`. No task is created and nothing is charged
        '401':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: unauthorized
                      message: Invalid API key
                      type: authentication_error
                      http_status: 401
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`unauthorized`: missing or invalid API Key'
        '402':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: insufficient_balance
                      message: Insufficient balance
                      type: insufficient_balance_error
                      http_status: 402
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`insufficient_balance`: insufficient balance, top up and retry'
        '403':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: forbidden
                      message: No permission to access this resource
                      type: permission_error
                      http_status: 403
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`forbidden`: no permission for this resource'
        '404':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: not_found
                      message: Model not found or not enabled
                      type: invalid_request_error
                      http_status: 404
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`not_found`: task not found, or model unknown / not enabled'
        '429':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: rate_limit_exceeded
                      message: Rate limit exceeded. Please try again later.
                      type: rate_limit_error
                      http_status: 429
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`rate_limit_exceeded`: too many requests, retry later'
        '500':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: api_error
                      message: Internal server error, please retry later
                      type: api_error
                      http_status: 500
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: '`api_error`: internal error, retryable'
        '503':
          content:
            application/json:
              examples:
                example:
                  value:
                    error:
                      code: service_unavailable
                      message: Service temporarily unavailable, please retry later
                      type: api_error
                      http_status: 503
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/SeedanceV3ErrorResponse'
          description: >-
            `service_unavailable`: temporarily unavailable (502 / 503 / 504),
            retryable
components:
  schemas:
    SeedanceV3CreateTaskRequest:
      additionalProperties: false
      description: >-
        Only the fields below are accepted; any other field returns 400
        "unsupported parameter: xxx".
      properties:
        model:
          default: seedance-2.5-flash
          description: >-
            **Required**: `seedance-2.5-flash`. Returns 404 if the model is not
            enabled for your account.
          enum:
            - seedance-2.5-flash
          examples:
            - seedance-2.5-flash
          type: string
        content:
          description: >-
            **Required**. At least one `text` prompt, plus optional reference
            images / videos / audios.


            - Media: public `http(s)` URLs, `asset://<asset Id>` or Base64
            `data:<kind>/<format>;base64,<data>` (up to 45 MB each after
            decoding, 64 MB for the whole request body)

            - Refer to media in the prompt by order: "image 1", "video 1",
            "audio 1"

            - Limits for this model: 10 images, 5 videos, 5 audios; exceeding
            them fails the task

            - A reference video means video editing / extension


            A missing `content` or no `text` item returns 400.
          items:
            discriminator:
              mapping:
                audio_url: '#/components/schemas/SeedanceV3AudioContent'
                image_url: '#/components/schemas/SeedanceV3ImageContent'
                text: '#/components/schemas/SeedanceV3TextContent'
                video_url: '#/components/schemas/SeedanceV3VideoContent'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/SeedanceV3TextContent'
              - $ref: '#/components/schemas/SeedanceV3ImageContent'
              - $ref: '#/components/schemas/SeedanceV3VideoContent'
              - $ref: '#/components/schemas/SeedanceV3AudioContent'
          minItems: 1
          type: array
        ratio:
          default: adaptive
          description: >-
            Output aspect ratio, default `adaptive`. With a first / last frame
            image the output follows the image.


            **Allowed values:**

            - `adaptive`: Adaptive (default): follows the reference image/video
            ratio, or lets the model choose for text-only prompts

            - `16:9`: Landscape widescreen, for desktop, TV and most video
            platforms

            - `9:16`: Portrait, for short-video apps and full-screen mobile

            - `1:1`: Square, for social feeds and avatar-style content

            - `4:3`: Classic landscape ratio

            - `3:4`: Portrait ratio, for people and product shots

            - `21:9`: Ultra-wide cinematic
          enum:
            - adaptive
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
            - '21:9'
          type: string
        duration:
          default: -1
          description: >-
            Video duration in seconds, `-1` (smart duration) when omitted.


            - Integer `4`–`30`: generate exactly that many seconds

            - `-1`: smart duration, the model picks 4–30 s and you are billed
            for actual usage; the actual length is returned as `duration` when
            querying

            - Decimals, strings or out-of-range values: 400 "duration must be an
            integer from 4 to 30 seconds, or -1 (smart duration)"
          enum:
            - -1
            - 4
            - 5
            - 6
            - 7
            - 8
            - 9
            - 10
            - 11
            - 12
            - 13
            - 14
            - 15
            - 16
            - 17
            - 18
            - 19
            - 20
            - 21
            - 22
            - 23
            - 24
            - 25
            - 26
            - 27
            - 28
            - 29
            - 30
          format: int64
          type: integer
        resolution:
          default: 720p
          description: >-
            Output resolution, default `720p`; this model supports `480p` /
            `720p`. Higher resolutions take longer and cost more. Other values
            return 400 "resolution must be one of: 480p, 720p".


            **Allowed values:**

            - `480p`: SD; fastest and cheapest, good for previews and quick
            iteration

            - `720p`: HD (default); balanced quality and speed
          enum:
            - 480p
            - 720p
          type: string
        generate_audio:
          default: true
          description: >-
            Generate audio (effects, music, voice), default `true`; `false`
            outputs a silent video.
          type: boolean
        output_format:
          description: |-
            Output container format, default `mp4`.

            **Allowed values:**
            - `mp4`: MP4 (default), the most compatible
            - `mov`: QuickTime MOV, convenient for editing software
          enum:
            - mp4
            - mov
          type: string
        watermark:
          default: false
          description: Add a watermark, default `false`.
          type: boolean
        seed:
          description: >-
            Random seed. The same seed and parameters usually give similar
            results, which helps reproduction; not guaranteed identical.
          format: int64
          type: integer
        return_last_frame:
          description: >-
            Return the last frame. When `true`, a succeeded task returns
            `content.last_frame_url`, usable as the next clip's first frame.
          type: boolean
        callback_url:
          description: >-
            Callback URL (`http(s)`) notified when the task ends. See [Task
            callback](/en/webhooks/task-callback).
          format: uri
          type: string
        tools:
          description: >-
            Tools to enable. Only web search is supported: `[{"type":
            "web_search"}]`.
          items:
            $ref: '#/components/schemas/SeedanceV3Tool'
          type: array
        priority:
          description: Task priority (integer), scheduled by the model side.
          format: int64
          type: integer
        service_tier:
          description: Service tier, decided by the model side.
          type: string
        execution_expires_after:
          description: Execution timeout in seconds; tasks still unfinished may be stopped.
          format: int64
          type: integer
        safety_identifier:
          description: >-
            End-user identifier for content-safety review. Send a hashed user
            ID, never plain personal data.
          type: string
        omni_reference_task_type:
          description: >-
            Reference task type; derived from `content` when omitted. `edit` /
            `extend` need a reference video in `content`. Case-sensitive; other
            values return 400 "omni_reference_task_type must be one of: auto,
            reference, edit, extend".


            **Allowed values:**

            - `auto`: Auto: derived from the media in `content`

            - `reference`: Reference: generate a new video from the reference
            media

            - `edit`: Edit: change the content of the reference video; needs a
            reference video

            - `extend`: Extend: continue the reference video; needs a reference
            video
          enum:
            - auto
            - reference
            - edit
            - extend
          type: string
      required:
        - model
        - content
      type: object
    SeedanceV3CreateTaskResponse:
      additionalProperties: false
      description: Successful creation response.
      properties:
        id:
          description: >-
            Task ID, prefixed with `task_`. Use it to query the task; the
            callback `taskId` carries the same value.
          examples:
            - task_8c1d2e3f4a5b6c7d8e9f0a1b
          type: string
        request_id:
          description: >-
            ID of this request (prefixed with `req_`), same as the
            `X-Request-Id` header. Include it and the task `id` when contacting
            support.
          examples:
            - req_3f9a1c2b7d4e5f60718293a4
          type: string
      required:
        - id
        - request_id
      type: object
    SeedanceV3ErrorResponse:
      additionalProperties: false
      description: >-
        Error response. Branch on the HTTP status first (retry / fix parameters
        / top up), then on `error.code` and `error.param`.
      properties:
        error:
          $ref: '#/components/schemas/SeedanceV3ErrorBody'
          description: Error object.
        request_id:
          description: >-
            ID of this request (prefixed with `req_`), same as the
            `X-Request-Id` header. Include it and the task `id` when contacting
            support.
          examples:
            - req_3f9a1c2b7d4e5f60718293a4
          type: string
      required:
        - error
        - request_id
      type: object
    SeedanceV3AudioContent:
      additionalProperties: false
      description: >-
        Reference audio such as music, narration or rhythm. Up to 3 audios; wav
        / mp3, 2–15 s, max 15 MB each.
      properties:
        type:
          description: Content type, always `audio_url`.
          enum:
            - audio_url
          type: string
        audio_url:
          $ref: '#/components/schemas/SeedanceV3MediaURL'
          description: Audio URL object.
        role:
          description: >-
            Always `reference_audio` (reference audio); may be omitted. Other
            values return 400.
          enum:
            - reference_audio
          type: string
      required:
        - type
        - audio_url
      title: Audio
      type: object
    SeedanceV3ImageContent:
      additionalProperties: false
      description: >-
        Reference image. Up to 9 images; jpeg / png / webp / bmp / tiff / gif,
        aspect ratio 0.4–2.5, sides 300–6000 px, max 30 MB each.
      properties:
        type:
          description: Content type, always `image_url`.
          enum:
            - image_url
          type: string
        image_url:
          $ref: '#/components/schemas/SeedanceV3MediaURL'
          description: Image URL object.
        role:
          description: >-
            How the image is used. Case-sensitive; other values return 400
            "content[n].role must be one of: reference_image, first_frame,
            last_frame".


            **Allowed values:**

            - `reference_image`: Reference image: subject, style or scene to
            draw from; multiple allowed, referenced in the prompt as "image 1",
            "image 2"

            - `first_frame`: First frame: the video starts from this image

            - `last_frame`: Last frame: the video ends on this image; usually
            paired with `first_frame` for a transition
          enum:
            - reference_image
            - first_frame
            - last_frame
          type: string
      required:
        - type
        - image_url
      title: Image
      type: object
    SeedanceV3TextContent:
      additionalProperties: false
      description: Text prompt. At least one is required in content.
      properties:
        type:
          description: Content type, always `text`.
          enum:
            - text
          type: string
        text:
          description: >-
            Video prompt, 3–20000 characters after trimming whitespace,
            otherwise 400 "prompt text must be 3 to 20000 characters".


            Tips: subject + action, background + action, camera + motion (push
            in, pull out, orbit…). Reference media as "image 1", "video 1",
            "audio 1"; never put asset Ids in the prompt.
          maxLength: 20000
          minLength: 3
          type: string
      required:
        - type
        - text
      title: Text
      type: object
    SeedanceV3VideoContent:
      additionalProperties: false
      description: >-
        Reference video for editing or extension. Up to 3 videos; mp4 / mov,
        480p / 720p, 2–15 s, 24–60 FPS, max 50 MB each.
      properties:
        type:
          description: Content type, always `video_url`.
          enum:
            - video_url
          type: string
        video_url:
          $ref: '#/components/schemas/SeedanceV3MediaURL'
          description: Video URL object.
        role:
          description: >-
            Always `reference_video` (reference video); may be omitted. Other
            values return 400.
          enum:
            - reference_video
          type: string
      required:
        - type
        - video_url
      title: Video
      type: object
    SeedanceV3Tool:
      additionalProperties: false
      description: A tool.
      properties:
        type:
          description: Tool type; only `web_search` (web search) is supported.
          enum:
            - web_search
          type: string
      required:
        - type
      type: object
    SeedanceV3ErrorBody:
      additionalProperties: false
      description: Error object.
      properties:
        code:
          description: >-
            Error code: `invalid_parameter` (validation failed),
            `invalid_request`, `unauthorized`, `insufficient_balance`,
            `forbidden`, `not_found`, `rate_limit_exceeded`, `api_error`,
            `service_unavailable`.
          examples:
            - invalid_parameter
          type: string
        message:
          description: Readable error description that can be shown to users.
          type: string
        type:
          description: >-
            Error category: `invalid_request_error`, `authentication_error`,
            `insufficient_balance_error`, `permission_error`,
            `rate_limit_error`, `api_error`.
          examples:
            - invalid_request_error
          type: string
        http_status:
          description: Same as the HTTP status code of the response.
          examples:
            - 400
          format: int64
          type: integer
        request_id:
          description: >-
            Request ID, same as the `X-Request-Id` header; include it when
            contacting support.
          examples:
            - req_3f9a1c2b7d4e5f60718293a4
          type: string
        param:
          description: >-
            The offending request field, present only for validation errors,
            e.g. `duration`, `content[1]`.
          examples:
            - duration
          type: string
      required:
        - code
        - message
        - type
        - http_status
        - request_id
      type: object
    SeedanceV3MediaURL:
      additionalProperties: false
      description: Media URL.
      properties:
        url:
          description: >-
            Media URL, **required**, one of:


            - a publicly reachable `http` / `https` URL (no auth, not
            intranet-only)

            - an asset-library reference `asset://<asset Id>`: the asset must
            belong to your account and be `Active`; not ready, missing or
            deleted assets return 400 and nothing is charged

            - inline Base64 data `data:<kind>/<format>;base64,<data>`, where the
            kind matches the item (`image` for `image_url`, `video` for
            `video_url`, `audio` for `audio_url`) e.g.
            `data:image/png;base64,iVBORw0...`; at most 45 MB per item after
            decoding (64 MB for the whole request body); invalid data returns
            400 "content[n].image_url.url is not valid base64 data". The gateway
            stores it as a URL before submitting; prefer URLs for large videos
            and audio


            Other schemes return 400 "content[n].image_url.url must be an
            http/https URL, asset://<asset Id> or
            data:image/<format>;base64,<data>".
          examples:
            - https://example.com/portrait.jpg
          type: string
      required:
        - url
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        Send `Authorization: Bearer <API Key>`. Create API Keys in the DreamTo
        console; all Keys of an account share the asset library.
      scheme: bearer
      type: http

````

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