Tradução de apoio para consulta. Código e identificadores técnicos preservados. Consultar referência original ↗
wan3.0-video Resultado da tarefa de consulta
Consultar o status e o resultado de um wan3.0-video tarefa de geração de vídeo.
OpenAPI
openapi: 3.1.0
info:
title: Wan 3.0 Video Generation API
description: Wan 3.0 is an All-in-One video generation model that supports text-to-video, image-to-video (first-frame / first+last-frame), reference-to-video, and file-to-video, generating videos up to 30 seconds. Submit a task asynchronously, then poll `GET /tasks/{task_id}` for the result.
version: 1.0.0
servers:
- url: https://maas.qwencloudapi.com/api/v1
description: QwenCloud
security:
- BearerAuth: []
paths:
/tasks/{task_id}:
get:
operationId: getWan30VideoTaskStatus
summary: Query video generation task result
description: "Poll task status. Once the task succeeds, retrieve the video URL. Recommended polling interval: 15 seconds. task_id is valid for 24 hours."
parameters:
- name: task_id
in: path
required: true
description: The task ID returned when you submitted the task.
schema:
type: string
responses:
"200":
description: Task status retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Wan30VideoTaskStatusResponse"
examples:
SUCCEEDED:
summary: Task succeeded
value:
request_id: 78c9b768-0285-996c-b682-xxxxxx
output:
task_id: 17ed7e50-00cf-4509-aea1-xxxxxx
task_status: SUCCEEDED
submit_time: 2026-08-06 10:01:35.452
scheduled_time: 2026-08-06 10:01:35.507
end_time: 2026-08-06 10:13:33.838
orig_prompt: A golden retriever running on a sunny beach, waves crashing in the background, cinematic lighting
video_url: https://dashscope-result-sg.oss-ap-southeast-1.aliyuncs.com/xxx/video.mp4
usage:
video_count: 1
duration: 5
input_video_duration: 0
output_video_duration: 5
fps: 30
SR: 720
ratio: 16:9
FAILED:
summary: Task failed
value:
request_id: e5e57877-c0fc-47ed-8fad-xxxxxx
output:
task_id: eff1443c-ccab-4676-aad3-xxxxxx
task_status: FAILED
code: InvalidParameter
message: The two modes are mutually exclusive. Do not pass reference_xx and first_frame/last_frame at the same time.
RUNNING:
summary: Task running
value:
request_id: c1209113-8437-424f-a386-xxxxxx
output:
task_id: 17ed7e50-00cf-4509-aea1-xxxxxx
task_status: RUNNING
submit_time: 2026-08-06 10:01:35.452
scheduled_time: 2026-08-06 10:01:35.507
UNKNOWN:
summary: Task expired
value:
request_id: a4de7c32-7057-9f82-8581-xxxxxx
output:
task_id: 502a00b1-19d9-4839-a82f-xxxxxx
task_status: UNKNOWN
"400":
description: Invalid request parameters
content:
application/json:
schema:
$ref: "#/components/schemas/DashScopeErrorResponse"
x-codeSamples:
- lang: curl
label: Query task result
source: |-
curl -X GET 'https://maas.qwencloudapi.com/api/v1/tasks/{task_id}' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: QwenCloud API Key. See [Get an API Key](/api-reference/preparation/api-key).
schemas:
Wan30VideoRequest:
type: object
required:
- model
- input
properties:
model:
type: string
description: |-
Model name. Valid values:
- `wan3.0-video-prime`: High-speed version with capabilities aligned to the standard version, with significantly improved end-to-end speed.
- `wan3.0-video`: Standard version.
enum:
- wan3.0-video-prime
- wan3.0-video
example: wan3.0-video
input:
type: object
description: Input information. Either `prompt` or `media` is required.
properties:
prompt:
type: string
description: Text prompt describing the desired video content. Either this or `media` is required. Supports Chinese and English, up to 20,000 characters (auto-truncated beyond). In all-in-one reference mode, use "Image1", "Video1", "Audio1" etc. in the prompt to refer to media items by their array order.
maxLength: 20000
example: A kitten running on rooftops under moonlight, neon lights flickering in the distance, cinematic quality, smooth camera movement.
media:
type: array
description: Media array supporting images, videos, audio, files, and web links as input. Either this or `prompt` is required. In reference mode, array order defines the numbering in prompts (images and videos are counted separately). `reference_xx`/`file`/`link` types and `first_frame`/`last_frame` types are mutually exclusive.
items:
$ref: "#/components/schemas/MediaItem"
parameters:
$ref: "#/components/schemas/Wan30VideoParameters"
MediaItem:
type: object
required:
- type
- url
properties:
type:
type: string
description: |-
Media type. `reference_xx`/`file`/`link` types and `first_frame`/`last_frame` types are mutually exclusive within the same request.
Media limits by type:
- `reference_image` / `first_frame` / `last_frame` (image): JPEG/JPG/PNG/BMP/WEBP; resolution [240, 8000] per side; aspect ratio ≤ 8:1; file size ≤ 20MB.
- `reference_video` (video): mp4/mov; duration [1, 15]s per clip, total ≤ 15s; frame rate ≥ 16 fps; resolution [240, 4096] per side; aspect ratio ≤ 8:1; file size ≤ 100MB per clip.
- `reference_audio` (audio): wav/mp3; duration [1, 15]s per clip, total ≤ 15s; file size ≤ 15MB.
- `file`: docx/doc/xlsx/xls/pptx/ppt/pdf/txt/key/pages/numbers/md; file size ≤ 100MB; page limit ≤ 50 pages (validated for pdf/docx/doc/pptx/ppt/key/pages).
enum:
- first_frame
- last_frame
- reference_image
- reference_video
- reference_audio
- file
- link
url:
type: string
description: Media URL or Base64-encoded data. Supports public URLs (HTTP/HTTPS) and Base64 encoding (`data:{MIME_type};base64,{data}`).
Wan30VideoParameters:
type: object
description: Video generation parameters.
properties:
resolution:
type: string
description: Output video resolution tier.
enum:
- 480P
- 720P
- 1080P
default: 1080P
ratio:
type: string
description: Output video aspect ratio. `adaptive` automatically selects the best ratio based on input media and intent.
enum:
- adaptive
- 21:9
- 16:9
- 4:3
- 1:1
- 3:4
- 9:16
default: adaptive
duration:
type: integer
description: "Output video duration in seconds. Without video input: integer in [2, 30]. With video input: input + output duration must not exceed 30s. Set to `-1` for smart duration mode (model selects optimal length)."
default: 5
audio:
type: boolean
description: "Whether the output video includes audio. `true` (default): includes sound. `false`: no audio track. Pricing is the same regardless of this setting."
default: true
seed:
type: integer
description: "Random seed. Used to reproduce generation results. Value range: -1 or [0, 2147483647]. When set to -1 or not specified, the system automatically generates a random seed. Even with the same seed value, generation results may not be perfectly identical."
minimum: -1
maximum: 2147483647
watermark:
type: boolean
description: Whether to add a watermark.
default: false
prompt_extend:
type: boolean
description: Whether to enable intelligent prompt rewriting. When enabled, a large language model rewrites the input prompt to improve video generation quality. Recommended for shorter prompts; increases latency slightly. When a document (`file`) or webpage (`link`) is provided as input, `prompt_extend` must be set to `true`.
default: true
AsyncTaskSubmitResponse:
type: object
description: Async task submission response.
properties:
request_id:
type: string
description: Unique request identifier for tracing and troubleshooting.
example: 4909100c-7b5a-9f92-bfe5-xxxxxx
output:
type: object
properties:
task_id:
type: string
description: Task ID, valid for 24 hours. Use with `GET /tasks/{task_id}`. Do not re-create the task; poll instead.
example: 0385dc79-5ff8-4d82-bcb6-xxxxxx
task_status:
type: string
description: Initial task status, typically `PENDING`.
enum:
- PENDING
- RUNNING
- SUCCEEDED
- FAILED
- CANCELED
- UNKNOWN
Wan30VideoTaskStatusResponse:
type: object
description: Wan 3.0 video generation task status response.
properties:
request_id:
type: string
description: Unique request identifier for tracing and troubleshooting.
example: 78c9b768-0285-996c-b682-xxxxxx
output:
type: object
properties:
task_id:
type: string
description: Task ID.
example: 17ed7e50-00cf-4509-aea1-xxxxxx
task_status:
type: string
description: "Task status. Flow: `PENDING` (queued) -> `RUNNING` (processing) -> `SUCCEEDED` / `FAILED`. Manually canceled: `CANCELED`. Expired: `UNKNOWN`."
enum:
- PENDING
- RUNNING
- SUCCEEDED
- FAILED
- CANCELED
- UNKNOWN
submit_time:
type: string
description: "Task submission time. Format: YYYY-MM-DD HH:mm:ss.SSS."
example: 2026-08-06 10:01:35.452
scheduled_time:
type: string
description: "Task execution start time. Format: YYYY-MM-DD HH:mm:ss.SSS."
example: 2026-08-06 10:01:35.507
end_time:
type: string
description: "Task completion time. Format: YYYY-MM-DD HH:mm:ss.SSS. Only returned for `SUCCEEDED` or `FAILED`."
example: 2026-08-06 10:13:33.838
orig_prompt:
type: string
description: Original input prompt text.
video_url:
type: string
format: uri
description: Generated video URL. Only returned when `task_status` is `SUCCEEDED`. Valid for 24 hours — download promptly.
example: https://dashscope-result-sg.oss-ap-southeast-1.aliyuncs.com/xxx/video.mp4
code:
type: string
description: Error code. Only returned when `task_status` is `FAILED`.
message:
type: string
description: Error message. Only returned when `task_status` is `FAILED`.
usage:
type: object
description: Usage statistics. Only counted for successful results.
properties:
video_count:
type: integer
description: Number of generated videos. Fixed at 1.
duration:
type: number
description: Total video duration in seconds. When no input reference video is provided, it equals the output video duration; when an input reference video is provided, it equals the sum of the input video duration and the output video duration.
input_video_duration:
type: number
description: Input video duration in seconds. Returns 0.0 when no video is provided as input.
output_video_duration:
type: number
description: Output video duration in seconds.
fps:
type: integer
description: "Generated video frame rate. Default value: 30."
SR:
type: integer
description: Generated video resolution tier (e.g. 720 for 720P).
ratio:
type: string
description: Generated video aspect ratio (e.g. 16:9).
DashScopeErrorResponse:
type: object
description: API error response.
properties:
request_id:
type: string
description: Unique request identifier for tracing and troubleshooting.
code:
type: string
description: Error code.
example: InvalidApiKey
message:
type: string
description: Error description.
example: Invalid API-key provided.