> ## 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 generation task

> Creates an asynchronous video task: text-to-video, image-to-video (first frame / first and last frame), omni-reference (images / videos / audio / documents / web pages), video editing and extension. The `X-DashScope-Async: enable` header is required. Returns a `task_id`; poll the query endpoint for the result. Invalid parameters return 400 without creating or charging a task; failed tasks are not charged.



## OpenAPI

````yaml /openapi/en/wan-3-0.json post /api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.1.0
info:
  description: >-
    Wan 3.0 video generation: create text-to-video, image-to-video (first frame
    / first and last frame), omni-reference, video editing and extension tasks,
    and query their results. Requests and responses follow the official Alibaba
    Cloud Model Studio (DashScope) protocol.
  title: Wan 3.0 Video API
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Wan 3.0
paths:
  /api/v1/services/aigc/video-generation/video-synthesis:
    post:
      tags:
        - Wan 3.0
      summary: Create video generation task
      description: >-
        Creates an asynchronous video task: text-to-video, image-to-video (first
        frame / first and last frame), omni-reference (images / videos / audio /
        documents / web pages), video editing and extension. The
        `X-DashScope-Async: enable` header is required. Returns a `task_id`;
        poll the query endpoint for the result. Invalid parameters return 400
        without creating or charging a task; failed tasks are not charged.
      operationId: wanCreateVideoSynthesis
      parameters:
        - description: >-
            Asynchronous call switch; must be `enable`. Without it the request
            fails with 403 `AccessDenied`.
          example: enable
          in: header
          name: X-DashScope-Async
          required: true
          schema:
            enum:
              - enable
            examples:
              - enable
            type: string
      requestBody:
        content:
          application/json:
            examples:
              Text to video:
                description: Prompt only.
                summary: Text to video
                value:
                  model: wan3.0-video
                  input:
                    prompt: >-
                      A small red paper boat floats down a rain-filled street
                      gutter, close-up, soft morning light.
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    duration: 5
              Image to video (first frame):
                description: The image is used exactly as the first frame.
                summary: Image to video (first frame)
                value:
                  model: wan3.0-video
                  input:
                    prompt: Slow push-in as steam rises from the ramen bowl.
                    media:
                      - type: first_frame
                        url: https://your-cdn.example.com/first-frame.jpg
                  parameters:
                    resolution: 1080P
                    duration: 5
              First and last frame:
                description: >-
                  Transition from the first to the last frame. Frame mode takes
                  no audio input.
                summary: First and last frame
                value:
                  model: wan3.0-video
                  input:
                    prompt: >-
                      The character walks from the window to the door; the
                      camera follows.
                    media:
                      - type: first_frame
                        url: https://your-cdn.example.com/first-frame.jpg
                      - type: last_frame
                        url: https://your-cdn.example.com/last-frame.jpg
                  parameters:
                    resolution: 720P
                    duration: 6
              Omni reference (image + video + audio):
                description: >-
                  Refer to media as "image 1", "video 1", "audio 1" in the
                  prompt.
                summary: Omni reference (image + video + audio)
                value:
                  model: wan3.0-video
                  input:
                    prompt: >-
                      The person from image 1 stands in the scene of video 1 and
                      says, in the voice of audio 1: welcome to the future.
                    media:
                      - type: reference_image
                        url: https://your-cdn.example.com/person.png
                      - type: reference_video
                        url: https://your-cdn.example.com/scene.mp4
                      - type: reference_audio
                        url: https://your-cdn.example.com/voice.mp3
                  parameters:
                    resolution: 1080P
                    ratio: '16:9'
                    duration: 8
              Video extension:
                description: >-
                  `ratio` must be `adaptive` and the prompt should ask for an
                  extension; the input video duration is billed too.
                summary: Video extension
                value:
                  model: wan3.0-video
                  input:
                    prompt: >-
                      Extend the video: the paper boat keeps floating forward
                      and drifts out of frame.
                    media:
                      - type: reference_video
                        url: https://your-cdn.example.com/source.mp4
                  parameters:
                    resolution: 720P
                    ratio: adaptive
                    duration: 5
              Document to video:
                description: >-
                  `file` can be combined with reference images; `prompt_extend`
                  must be `true`.
                summary: Document to video
                value:
                  model: wan3.0-video
                  input:
                    prompt: >-
                      Make a 15-second product video from the document; the
                      product looks like image 1.
                    media:
                      - type: file
                        url: https://your-cdn.example.com/product-brief.pdf
                      - type: reference_image
                        url: https://your-cdn.example.com/product.png
                  parameters:
                    resolution: 1080P
                    ratio: '9:16'
                    duration: 15
                    prompt_extend: true
              Prime · smart duration:
                description: >-
                  `wan3.0-video-prime` has the same capabilities and is faster;
                  `duration` `-1` lets the model choose.
                summary: Prime · smart duration
                value:
                  model: wan3.0-video-prime
                  input:
                    prompt: >-
                      A paper lantern drifts upward into a starry night sky,
                      slow camera tilt.
                  parameters:
                    resolution: 480P
                    ratio: '9:16'
                    duration: -1
                    audio: true
                    seed: 42
                    watermark: false
            schema:
              $ref: '#/components/schemas/WanVideoSynthesisRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                example:
                  value:
                    output:
                      task_status: PENDING
                      task_id: 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/WanVideoCreateResponse'
          description: Task created.
          headers:
            X-Request-Id:
              description: Request ID. Include it when contacting support.
              schema:
                type: string
        '400':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: InvalidParameter
                    message: >-
                      Input should be '1080P', '720P' or '480P':
                      parameters.resolution
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: Invalid parameters (`InvalidParameter`).
        '401':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: InvalidApiKey
                    message: Invalid API-key provided.
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: Missing or invalid API Key (`InvalidApiKey`).
        '402':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: Arrearage
                    message: >-
                      Access denied, please make sure your account is in good
                      standing.
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: Insufficient balance (`Arrearage`).
        '403':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: AccessDenied
                    message: current user api does not support synchronous calls
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: >-
            Missing `X-DashScope-Async: enable` header, or no access to the
            model (`AccessDenied`).
        '429':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: Throttling.RateQuota
                    message: Requests rate limit exceeded, please try again later.
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: Rate limited; retry later (`Throttling.RateQuota`).
        '500':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: InternalError
                    message: >-
                      An internal error has occured, please try again later or
                      contact service support.
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: Server error; retry later (`InternalError`).
components:
  schemas:
    WanVideoSynthesisRequest:
      additionalProperties: false
      description: Request body of a video generation task.
      properties:
        model:
          default: wan3.0-video
          description: >-
            Model name: `wan3.0-video` (standard) or `wan3.0-video-prime`
            (high-speed, same capabilities, faster end to end).


            **Allowed values:**

            - `wan3.0-video`: Wan 3.0 standard.

            - `wan3.0-video-prime`: Wan 3.0 Prime: same capabilities as
            standard, faster end to end.
          enum:
            - wan3.0-video
            - wan3.0-video-prime
          type: string
        input:
          $ref: '#/components/schemas/WanVideoInput'
          description: Prompt and input media.
        parameters:
          $ref: '#/components/schemas/WanVideoParameters'
          description: Generation parameters; all optional.
      required:
        - model
        - input
      type: object
    WanVideoCreateResponse:
      additionalProperties: false
      description: Create response.
      properties:
        output:
          $ref: '#/components/schemas/WanVideoCreateOutput'
          description: Task information.
        request_id:
          description: Request ID.
          type: string
      required:
        - output
        - request_id
      type: object
    WanVideoErrorResponse:
      additionalProperties: false
      description: Error response.
      properties:
        request_id:
          description: Request ID; include it when contacting support.
          type: string
        code:
          description: Error code, e.g. `InvalidParameter`, `InvalidApiKey`.
          type: string
        message:
          description: Error message (English).
          type: string
      required:
        - request_id
        - code
        - message
      type: object
    WanVideoInput:
      additionalProperties: false
      description: Input. At least one of `prompt` and `media` is required.
      properties:
        prompt:
          description: >-
            Text prompt in Chinese or English, up to 20000 characters (longer
            prompts are truncated). In omni-reference mode, refer to media by
            order, e.g. "image 1", "video 1", "audio 1".
          type: string
        media:
          description: >-
            Input media, each with `type` and `url`. Rules: omit for
            text-to-video; `first_frame` / `last_frame` are used alone or
            together and cannot be mixed with other types (frame mode takes no
            audio); `reference_image` / `reference_video` / `reference_audio`
            combine freely; use either `file` or `link`, optionally with
            references; video editing and extension need a `reference_video`.
          items:
            $ref: '#/components/schemas/WanVideoMedia'
          type: array
      type: object
    WanVideoParameters:
      additionalProperties: false
      description: Generation parameters.
      properties:
        resolution:
          default: 1080P
          description: |-
            Output resolution tier, default `1080P`; sets the price per second.

            **Allowed values:**
            - `1080P`: 1080P.
            - `720P`: 720P.
            - `480P`: 480P.
          enum:
            - 1080P
            - 720P
            - 480P
          type: string
        ratio:
          default: adaptive
          description: >-
            Aspect ratio, default `adaptive`. Must be `adaptive` for video
            extension.


            **Allowed values:**

            - `adaptive`: Adaptive: follows the input media or is chosen by the
            model.

            - `21:9`: 21:9 ultra-wide.

            - `16:9`: 16:9 landscape.

            - `4:3`: 4:3 landscape.

            - `1:1`: 1:1 square.

            - `3:4`: 3:4 portrait.

            - `9:16`: 9:16 portrait.
          enum:
            - adaptive
            - '21:9'
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
          type: string
        duration:
          default: 5
          description: >-
            Output duration in seconds, default `5`. `2`–`30` without input
            video; with input video, input plus output must not exceed 30
            seconds; `-1` lets the model choose.
          format: int64
          maximum: 30
          minimum: -1
          type: integer
        audio:
          default: true
          description: Whether to generate audio, default `true`. Same price either way.
          type: boolean
        seed:
          description: >-
            Random seed, `-1` or `0`–`2147483647`; random when omitted. The same
            seed does not guarantee identical results.
          format: int64
          maximum: 2147483647
          minimum: -1
          type: integer
        prompt_extend:
          default: true
          description: >-
            Whether to rewrite the prompt intelligently, default `true` (adds
            latency). Must be `true` when using `file` or `link`.
          type: boolean
        watermark:
          default: false
          description: Whether to add a watermark, default `false`.
          type: boolean
      type: object
    WanVideoCreateOutput:
      additionalProperties: false
      description: The new task.
      properties:
        task_status:
          description: >-
            Task status, `PENDING` when created.


            **Allowed values:**

            - `PENDING`: Waiting in the queue.

            - `RUNNING`: In progress.

            - `SUCCEEDED`: Succeeded; download `video_url`.

            - `FAILED`: Failed; see `code` / `message`. Not charged.

            - `CANCELED`: Canceled. Not charged.

            - `UNKNOWN`: The task does not exist, belongs to another account, or
            is past its 24-hour query window.
          enum:
            - PENDING
            - RUNNING
            - SUCCEEDED
            - FAILED
            - CANCELED
            - UNKNOWN
          type: string
        task_id:
          description: Task ID for the query endpoint, valid for 24 hours.
          type: string
      required:
        - task_status
        - task_id
      type: object
    WanVideoMedia:
      additionalProperties: false
      description: One input medium.
      properties:
        type:
          description: >-
            Media type.


            **Allowed values:**

            - `first_frame`: First frame, used exactly as the first frame of the
            video; at most 1.

            - `last_frame`: Last frame, used exactly as the last frame of the
            video; at most 1.

            - `reference_image`: Reference image, at most 10. JPEG / JPG / PNG
            (no alpha) / BMP / WEBP, 240–8000 px per side, aspect ratio ≤ 8:1, ≤
            20 MB.

            - `reference_video`: Reference video, at most 5. MP4 / MOV, 1–15 s
            each and 15 s in total, ≥ 16 fps, 240–4096 px per side, ≤ 100 MB.

            - `reference_audio`: Reference audio, at most 5. WAV / MP3, 1–15 s
            each and 15 s in total, ≤ 15 MB.

            - `file`: A document, at most 1: docx, doc, xlsx, xls, pptx, ppt,
            pdf, txt, key, pages, numbers, md, ≤ 100 MB (some formats ≤ 50
            pages). Cannot be combined with `link`.

            - `link`: A web page, at most 1; public pages that need no login.
            Cannot be combined with `file`.
          enum:
            - first_frame
            - last_frame
            - reference_image
            - reference_video
            - reference_audio
            - file
            - link
          type: string
        url:
          description: >-
            Media URL: a publicly reachable `http(s)` URL; images (`first_frame`
            / `last_frame` / `reference_image`) may also be Base64 data
            `data:{MIME};base64,{data}`.
          minLength: 1
          type: string
      required:
        - type
        - url
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        Send your DreamTo API Key in the `Authorization: Bearer <API Key>`
        header.
      scheme: bearer
      type: http

````

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