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

# Query task

> Returns the task status and result. Generation usually takes a few minutes; poll about every 15 seconds and download `output.video_url` once `task_status` is `SUCCEEDED`. Task IDs are valid for 24 hours; unknown or expired tasks return `UNKNOWN`.



## OpenAPI

````yaml /openapi/en/wan-3-0.json get /api/v1/tasks/{task_id}
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/tasks/{task_id}:
    get:
      tags:
        - Wan 3.0
      summary: Query task
      description: >-
        Returns the task status and result. Generation usually takes a few
        minutes; poll about every 15 seconds and download `output.video_url`
        once `task_status` is `SUCCEEDED`. Task IDs are valid for 24 hours;
        unknown or expired tasks return `UNKNOWN`.
      operationId: wanQueryTask
      parameters:
        - description: The `task_id` returned when the task was created.
          example: 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
          in: path
          name: task_id
          required: true
          schema:
            examples:
              - 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
            type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                Pending:
                  summary: Pending
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    model: wan3.0-video
                    output:
                      task_id: 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
                      task_status: PENDING
                      submit_time: '2026-11-17 20:22:46.125'
                Running:
                  summary: Running
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    model: wan3.0-video
                    output:
                      task_id: 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
                      task_status: RUNNING
                      submit_time: '2026-11-17 20:22:46.125'
                      scheduled_time: '2026-11-17 20:22:46.230'
                Succeeded:
                  summary: Succeeded
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    model: wan3.0-video
                    output:
                      task_id: 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
                      task_status: SUCCEEDED
                      submit_time: '2026-11-17 20:22:46.125'
                      scheduled_time: '2026-11-17 20:22:46.230'
                      end_time: '2026-11-17 20:23:44.674'
                      video_url: >-
                        https://api.dreamto.ai/api/v1/video-files/wvf_3f9a1c2b7d4e5f60718293a4c5d6e7f8
                      orig_prompt: >-
                        A small red paper boat floats down a rain-filled street
                        gutter, close-up, soft morning light.
                    usage:
                      video_count: 1
                      duration: 5
                      SR: 720
                      output_video_duration: 5
                      input_video_duration: 0
                      fps: 30
                      ratio: '16:9'
                Failed:
                  summary: Failed
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    model: wan3.0-video
                    output:
                      task_id: 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
                      task_status: FAILED
                      submit_time: '2026-11-17 20:22:46.125'
                      scheduled_time: '2026-11-17 20:22:46.230'
                      end_time: '2026-11-17 20:22:51.581'
                      code: InvalidParameter
                      message: >-
                        Failed to download
                        https://your-cdn.example.com/first-frame.jpg
                Unknown task:
                  summary: Unknown task
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    output:
                      task_id: 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
                      task_status: UNKNOWN
              schema:
                $ref: '#/components/schemas/WanVideoTaskResponse'
          description: Task details; `task_status` is `UNKNOWN` for unknown tasks.
          headers:
            X-Request-Id:
              description: Request ID. Include it when contacting support.
              schema:
                type: string
        '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`).
        '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:
    WanVideoTaskResponse:
      additionalProperties: false
      description: Query response.
      properties:
        request_id:
          description: Request ID.
          type: string
        model:
          description: The model of the task; omitted when the task does not exist.
          type: string
        output:
          $ref: '#/components/schemas/WanVideoTaskOutput'
          description: Task status and result.
        usage:
          $ref: '#/components/schemas/WanVideoTaskUsage'
          description: Usage, only for succeeded tasks.
      required:
        - request_id
        - output
      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
    WanVideoTaskOutput:
      additionalProperties: false
      description: Task status and result.
      properties:
        task_id:
          description: Task ID.
          type: string
        task_status:
          description: >-
            Task status.


            **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
        submit_time:
          description: Submit time (UTC+8, `YYYY-MM-DD HH:mm:ss.SSS`).
          type: string
        scheduled_time:
          description: Time the task started running (UTC+8).
          type: string
        end_time:
          description: End time (UTC+8), once the task has finished.
          type: string
        video_url:
          description: >-
            The generated video (MP4, H.264), for succeeded tasks. A DreamTo
            download link valid for 24 hours from task creation; download and
            store it promptly.
          type: string
        orig_prompt:
          description: The original prompt.
          type: string
        code:
          description: Error code, for failed tasks.
          type: string
        message:
          description: Error message, for failed tasks.
          type: string
      required:
        - task_id
        - task_status
      type: object
    WanVideoTaskUsage:
      additionalProperties: false
      description: Usage.
      properties:
        video_count:
          description: Number of videos generated, always 1.
          format: int64
          type: integer
        duration:
          description: >-
            Billed duration in seconds: the output duration, plus the input
            video duration when there is one.
          format: double
          type: number
        SR:
          description: Output resolution tier (e.g. `720`).
          format: int64
          type: integer
        output_video_duration:
          description: Output video duration in seconds.
          format: double
          type: number
        input_video_duration:
          description: Input video duration in seconds, `0.0` without input video.
          format: double
          type: number
        fps:
          description: Frame rate, 30 by default.
          format: int64
          type: integer
        ratio:
          description: Aspect ratio of the output video.
          type: string
      required:
        - video_count
        - duration
        - SR
        - output_video_duration
        - input_video_duration
      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.