API guides

Wan 3.0 API guide: text, image and reference to video

How to call Wan 3.0 and Wan 3.0 Prime on DreamTo: one endpoint for text, first and last frame, omni reference, edit and extend, with limits and prices.

A glowing paper lantern drifting above a misty river valley at night
On this page

Wan 3.0 is Alibaba's video model, and on DreamTo it sits behind a single create endpoint. The same request generates from a prompt alone, starts from a first frame, bridges a first and a last frame, mixes up to 10 reference images, 5 reference videos and 5 reference audio clips, edits or extends an existing video, or works from a document or a web page. Output runs 2 to 30 seconds at 480P, 720P or 1080P, and synchronized audio is generated by default.

Two models share that endpoint: wan3.0-video and the accelerated wan3.0-video-prime. This guide covers the request and response, the parameters and limits, one request per input mode, prices, and how to choose between the two. $DREAMTO_API_KEY in the examples is your API key.

Wan 3.0 and Wan 3.0 Prime side by side#

The two models accept the same inputs and the same parameters. Wan 3.0 runs on standard inference. Wan 3.0 Prime runs the same model on accelerated inference; our catalog describes it as significantly faster at the same quality, and it costs more per second.

wan3.0-videowan3.0-video-prime
InferenceStandardAccelerated
Output480P, 720P or 1080P; 2 to 30 seconds; audio on by defaultSame
Input modesText, first frame, first and last frame, omni reference, edit, extend, document or web pageSame
PlaygroundTry Wan 3.0Try Wan 3.0 Prime

Switching between them means changing the model string. Nothing else in the request changes.

Create a task, then poll it#

Generation is asynchronous. One request creates a task and returns a task_id; a second request reads the task until it finishes. Both take an API key from the DreamTo console in the Authorization: Bearer header (see the authentication page).

StepRequest
CreatePOST https://api.dreamto.ai/api/v1/services/aigc/video-generation/video-synthesis
QueryGET https://api.dreamto.ai/api/v1/tasks/{task_id}

The create request also needs the header X-DashScope-Async: enable. Without it the call fails with 403 AccessDenied. Request and response bodies follow Alibaba's DashScope protocol, so code written for that protocol works after you change the base URL and the API key. With the DashScope SDK, set base_http_api_url to https://api.dreamto.ai/api/v1.

A text-to-video request is a model, a prompt and a few parameters:

bash
curl -X POST "https://api.dreamto.ai/api/v1/services/aigc/video-generation/video-synthesis" \  -H "Authorization: Bearer $DREAMTO_API_KEY" \  -H "Content-Type: application/json" \  -H "X-DashScope-Async: enable" \  -d '{    "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    }  }'

A successful create returns HTTP 200 with a queued task:

json
{  "request_id": "7d2c3a51-8f0e-4b6a-9c1d-2e3f4a5b6c7d",  "output": {    "task_id": "0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f",    "task_status": "PENDING"  }}

Keep the request_id and quote it when you report a problem.

Poll every 15 seconds and download the file#

The docs say generation usually takes a few minutes and recommend polling about every 15 seconds. task_status moves from PENDING to RUNNING and ends as SUCCEEDED, FAILED or CANCELED. UNKNOWN means the task does not exist, belongs to another account, or is past its 24-hour query window.

python
import osimport timeimport requestsBASE_URL = "https://api.dreamto.ai"HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}payload = {    "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},}created = requests.post(    f"{BASE_URL}/api/v1/services/aigc/video-generation/video-synthesis",    headers={**HEADERS, "X-DashScope-Async": "enable"},    json=payload,    timeout=60,).json()task_id = created["output"]["task_id"]while True:    output = requests.get(        f"{BASE_URL}/api/v1/tasks/{task_id}", headers=HEADERS, timeout=60    ).json()["output"]    if output["task_status"] in ("SUCCEEDED", "FAILED", "CANCELED", "UNKNOWN"):        break    time.sleep(15)print(output["task_status"], output.get("video_url"), output.get("message"))

A succeeded task carries the download link and the usage that was billed:

json
{  "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.0,    "SR": 720,    "output_video_duration": 5.0,    "input_video_duration": 0.0,    "fps": 30,    "ratio": "16:9"  }}

output.video_url is an MP4 (H.264) file on DreamTo. The link is valid for 24 hours counted from task creation, not from completion, and the task can be queried for the same 24 hours, so download the file when the task succeeds. The create request has no callback field in its reference; plan on polling.

Parameters, defaults and limits#

A value out of range returns HTTP 400 InvalidParameter; no task is created and nothing is charged. Everything under parameters is optional, and the request needs at least one of input.prompt and input.media.

FieldValues
modelwan3.0-video or wan3.0-video-prime
input.promptChinese or English, up to 20,000 characters; longer prompts are truncated
input.mediaArray of items, each with a type and a url
parameters.resolution480P, 720P, 1080P (default)
parameters.ratioadaptive (default), 21:9, 16:9, 4:3, 1:1, 3:4, 9:16
parameters.durationInteger 2 to 30 seconds (default 5), or -1 to let the model choose
parameters.audiotrue (default) or false; the price is the same either way
parameters.seed-1 or 0 to 2147483647; random when omitted. The same seed does not guarantee an identical clip
parameters.prompt_extendtrue (default) rewrites the prompt before generation and adds latency; must be true with a document or web page
parameters.watermarkfalse (default); true adds an "AI-generated" watermark

The type of a media item decides its role, and each type has its own limits:

typeCountLimits
first_frame1Used exactly as the first frame
last_frame1Used exactly as the last frame
reference_imageUp to 10JPEG, PNG without alpha, BMP or WEBP; 240 to 8000 px per side; aspect ratio up to 8:1; up to 20 MB
reference_videoUp to 5MP4 or MOV; 1 to 15 seconds each and 15 seconds in total; at least 16 fps; 240 to 4096 px per side; up to 100 MB
reference_audioUp to 5WAV or MP3; 1 to 15 seconds each and 15 seconds in total; up to 15 MB
file1docx, doc, xlsx, xls, pptx, ppt, pdf, txt, key, pages, numbers or md; up to 100 MB; some formats up to 50 pages
link1A public web page that needs no login

Check these before you send a request:

  • Frames and references do not mix. first_frame and last_frame are used alone or together and cannot be combined with any other type. The three reference types combine freely. Use either file or link, not both.
  • URLs must be public. Every url is an http(s) address reachable from the internet. The three image types also accept Base64 data. Temporary storage URLs such as oss:// are not supported.
  • The default resolution is 1080P, the most expensive tier. Set resolution yourself while you test prompts.
  • With an input video, input plus output may not exceed 30 seconds. A 12-second source leaves at most 18 seconds for the result.
  • Smart duration is API-only. The playground does not offer -1.

One request per input mode#

Each body below goes to the create endpoint with the same three headers as the first example. The Wan 3.0 docs page has an example page per mode with Python and Node.js versions.

Text to video#

Send input.prompt with no media, as in the request above. Describe the subject, the action, the setting, the camera and the light.

Image to video from a first frame#

Add one first_frame. The image is used exactly as the first frame, and the prompt describes what happens next. The aspect ratio follows the image, so leave ratio at adaptive.

json
{  "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 }}

For first-frame work across several models, see our image-to-video API guide.

First and last frame#

Send one first_frame and one last_frame, and the model generates the transition. The closer the two images are in composition and subject, the smoother the result. The prompt describes the motion and the camera in between. Frame mode takes no audio input.

json
{  "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 }}

A packaging reveal fits this mode: the closed box as the first frame, the open box as the last, and a prompt that directs the hand and the lid between them.

Omni reference#

Combine reference_image, reference_video and reference_audio items, and refer to them in the prompt by their order: "image 1", "video 1", "audio 1".

json
{  "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 }}

Give every asset a role in the prompt. An image can be the exact subject or only a style cue, and a video can supply the scene or only a direction of motion. Reference video seconds are billed and count toward the 30-second ceiling, so trim a clip to the part that shows the subject and the camera movement you want.

Video edit and video extend#

Both take one reference_video. For an edit, say in the prompt what to change (background, outfit, weather, style). What the prompt does not mention is kept as far as possible. To show what the replacement should look like, add a reference image and call it "image 1".

json
{  "model": "wan3.0-video",  "input": {    "prompt": "Turn the daytime street in video 1 into a rainy night with neon lights reflected on the wet road; keep the person's movement unchanged.",    "media": [      { "type": "reference_video", "url": "https://your-cdn.example.com/source.mp4" }    ]  },  "parameters": { "resolution": "720P", "duration": 5 }}

For an extension, say in the prompt that it is an extension and what happens next. ratio must be adaptive. The new footage continues the look and pace of the original.

json
{  "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 }}

In both cases the input video is billed along with the output. If you need pieces longer than 30 seconds, our Seedance 2.5 long-video guide covers how that model handles them.

Document or web page#

A file item points at a document and a link item at a public web page. Either can be combined with references, and prompt_extend must be true.

json
{  "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 }}

The playground form has no field for documents or links, so use the API for this mode.

Prices per second of video#

As of December 2026, DreamTo bills both models per second of video, at a rate set by the output resolution. These are the prices on our prices page:

Resolutionwan3.0-videowan3.0-video-prime
480P$0.035 per second$0.0476 per second
720P$0.07 per second$0.098 per second
1080P$0.14 per second$0.196 per second

They include a 30% discount on the list prices shown on the docs page: $0.05, $0.10 and $0.20 per second for wan3.0-video, and $0.068, $0.14 and $0.28 for wan3.0-video-prime.

The billed length is usage.duration in the query response: the output duration plus the duration of any input video, whether it was a reference, an edit source or an extension source. On wan3.0-video at 720P, a 5-second clip costs $0.35, and an edit that takes a 10-second source and returns 5 seconds is billed for 15 seconds, or $1.05.

Failed tasks, canceled tasks and invalid requests are not charged. Prices change, so check the prices page before you budget.

When to call Wan 3.0 and when Prime#

  • Call wan3.0-video when turnaround is not the constraint. It is the cheaper of the two at every resolution.
  • Call wan3.0-video-prime for review rounds. The catalog positions it for quick turnaround and for comparing several candidate shots. Hold ratio, duration and reference assets fixed across a batch, change only the action or the location, and judge every candidate against the same criteria.
  • Measure the speed yourself. Neither the catalog nor the docs gives a number. submit_time and end_time in the query response let you time your own tasks.
  • Expect an occasional fallback. The catalog notes that under load a Prime task may run on the standard model, and it is then billed as wan3.0-video.

If you draft at 480P and then render the chosen brief at 1080P, the second run is a new generation and not an upscale of the first, so review it again. Our camera movement prompt vocabulary has wording for the camera itself.

For how Wan compares with the other video models on DreamTo, see how to choose an AI video API, or browse the model list.

Error codes on the Wan endpoints#

Errors come back as an HTTP status with a body of request_id, code and message. Branch on the status, then on code:

HTTPcodeCauseWhat to do
400InvalidParameterInvalid parametersFix the request; no task was created or charged
401InvalidApiKeyMissing or invalid API keyCheck the Authorization header
402ArrearageInsufficient balanceTop up and retry
403AccessDeniedThe X-DashScope-Async: enable header is missing, or the key has no access to the modelAdd the header or check access
429Throttling.RateQuotaRate limitedRetry later
500InternalErrorServer errorRetry later

A task can also be accepted and fail later. The query then returns HTTP 200 with task_status set to FAILED and a code and message inside output; a media URL that cannot be downloaded is reported this way. The errors page has the platform's general retry advice, but its body shapes belong to other APIs.

FAQ#

What is the maximum length of a Wan 3.0 video?#

30 seconds per task. Set an integer duration from 2 to 30 (the default is 5), or -1 to let the model choose. With an input video, input and output together must stay within 30 seconds.

Does Wan 3.0 generate audio?#

Yes. Synchronized audio is generated by default at no extra cost; set parameters.audio to false to turn it off. In omni-reference mode you can supply up to 5 reference audio clips and name them in the prompt as "audio 1" and so on.

What is the difference between Wan 3.0 and Wan 3.0 Prime?#

They take the same inputs and parameters. Prime runs the model on accelerated inference, which the catalog describes as significantly faster at the same quality, and costs more per second. Under load a Prime task may fall back to the standard model and is then billed as that model.

Which resolutions and aspect ratios does it support?#

480P, 720P and 1080P, with 1080P as the default. Aspect ratios are adaptive (the default), 21:9, 16:9, 4:3, 1:1, 3:4 and 9:16. adaptive follows the input media, and video extension requires it.

How long do I have to download the finished video?#

24 hours from task creation. The output.video_url link expires then, and a query for the task returns task_status UNKNOWN. Download and store the file as soon as the task succeeds.

How much does the Wan 3.0 API cost?#

As of December 2026, wan3.0-video costs $0.035, $0.07 and $0.14 per second at 480P, 720P and 1080P, and wan3.0-video-prime costs $0.0476, $0.098 and $0.196 per second. The seconds of any input video are billed as well. See prices for current figures.

  • Wan 3.0
  • Video API