Skip to main content
Wan 2.7 and Wan 3.0 use DashScope-compatible asynchronous tasks. You need a token in the Wan group, and tasks are billed per second of video.
Don’t send Wan requests to /v1/videos. Image-to-video, reference-to-video, and video-editing tasks need the DashScope input.media[] payload, so create every Wan task through the endpoint in the table above.

Create a Wan token

Wan models are only available in the Wan group, so the token must use that group. Tokens in other groups, such as default or SeeDance2, can’t call them and fail with a no-channel error. A dedicated Wan token also makes logs and charges easy to audit by model and task.

Billing and pricing

Wan video is billed by the second, at Alibaba Cloud Model Studio’s list price plus 20%. The markup covers taxes, currency conversion and cross-border settlement, platform operations, and technical support. Since October 14, 2026, prices convert like this:
  • Price per second in USD = Alibaba Cloud’s list price per second in RMB × 0.1714 (the Wan group multiplier)
  • At the fixed exchange rate of 1:7, 0.1714 × 7 ≈ 1.2, so you pay about 1.2× the list price
Amounts in call logs already include the multiplier, so don’t apply it again. Prices per second: The Wan 2.7 text-to-video, image-to-video, reference-to-video, and video-editing models (wan2.7-t2v, wan2.7-i2v, wan2.7-r2v, and wan2.7-videoedit) cost the same. Alibaba Cloud prices are for the China North 2 (Beijing) region in Model Studio pricing (in Chinese). How the billed seconds are counted:
  • Output only (text to video, image to video, reference images only): the seconds of video generated.
  • With an input video: input seconds plus output seconds, the same rule Alibaba Cloud uses.
    • wan2.7-videoedit: the source video plus the output. If you set duration to 2–10 seconds, the source is trimmed from the start and only the trimmed part counts.
    • wan2.7-r2v with a reference video: up to 5 seconds of the reference video, plus the output.
    • Wan 3.0 with reference_video (reference, editing, or extension): all input video seconds plus the output.
  • No resolution: Wan 2.7 and Wan 3.0 both default to 1080P and are billed at 1080P.
Some example costs:
  • wan2.7-i2v, 720P, 5 seconds: 5 × $0.1028 ≈ $0.51
  • wan3.0-video, 1080P, 10 seconds: 10 × $0.2057 ≈ $2.06
  • wan2.7-videoedit on a 5-second clip at 720P: (5 + 5) × $0.1028 ≈ $1.03
When you create a task, the requested length is charged up front. When the task finishes, the charge is settled against the seconds Alibaba Cloud reports, and any difference is refunded or charged. Wan 3.0 tasks with an input video are charged 30 seconds up front and refunded the difference afterward, so your balance needs to cover that hold. Failed tasks aren’t billed, but submitting the same task twice is billed twice. Map your own business ID to each task_id and avoid unconditional automatic retries. The actual charge for each task is in call logs. If a failed task shows a charge, contact support with the task ID. Output length and resolution set the cost, so pass duration and resolution explicitly and estimate the cost from the table before you create a task. The model and pricing catalog lists the Wan models and their group.

How a Wan task works

1

Create a task

Send POST /wan/api/v1/services/aigc/video-generation/video-synthesis with a JSON body and the X-DashScope-Async: enable header. Save output.task_id from the response.
2

Poll the task

Send GET /v1/tasks/{task_id} every 5–10 seconds. Branch on the top-level status field, not on nested upstream fields.
3

Download the video

When status is completed, download the MP4 from the top-level result_url. It’s a signed object-storage URL, so don’t send your LaoZhang Authorization header with it.
The full request conventions, task statuses, and field reference follow the examples, starting at Endpoints and request conventions.

Set up your environment

The shell examples use curl and jq (install jq with brew install jq or sudo apt-get install jq). Set your key and the base URL once:
Each create example below saves its response to create.json, which the polling step reads.

Text to video

The create response returns the task ID in output.task_id:
If the response has no output.task_id, read the error message in create.json and check the troubleshooting table.

Image to video

driving_audio is optional. Alibaba Cloud uses the audio to drive the video, such as lip sync or motion that follows the beat, as in the rap example above. It only works together with a first_frame image, and it must be a public HTTPS URL like the other media. For accepted audio formats, length, and file size, see Alibaba Cloud’s Wan 2.7 image-to-video API reference.

Reference to video

Video editing

Wan 3.0 video generation

Wan 3.0 doesn’t split tasks across model IDs. One model reads the items in input.media[] and decides whether the job is text to video, image to video, reference to video, or video editing. The two models have the same capabilities:
  • wan3.0-video: the standard model.
  • wan3.0-video-prime: a faster model with a higher price per second.
Both use the same create endpoint, and you poll and download their tasks the same way as Wan 2.7. In reference-to-video prompts, you can point at inputs as “image 1”, “video 1”, or “audio 1” (图1, 视频1, 音频1), numbered by their order among inputs of the same type. A few parameters work differently from Wan 2.7: A minimal text-to-video request:
To restyle an existing clip, pass it as reference_video. The billed seconds include the input video; see Billing and pricing.
Read TASK_ID from create.json as before, then poll and download as in the next section. For other inputs, such as a document (file) or a web page (link), see Alibaba Cloud’s Wan3.0 video generation API reference (in Chinese).

Poll the task and download the video

Read the task ID from create.json and check the task:
Repeat the request every 5–10 seconds until status is no longer submitted or in_progress. A completed task looks like this. Rely on the top-level status and result_url fields:
Download the video without the Authorization header. result_url is a signed object-storage URL, and an extra auth header can cause a 403 error.

Python client

This client uses only the Python standard library (Python 3.8 or later). It creates a text-to-video task, polls for up to 20 minutes, and saves the MP4.

Endpoints and request conventions

Task statuses

Branch on the top-level status field returned by GET /v1/tasks/{task_id}: The create response also carries output.task_status, DashScope’s raw state, which is usually PENDING for a new task. Use it only to confirm that the task was accepted, and branch on the top-level status from GET /v1/tasks/{task_id} after that. Keep polling only while the status is submitted or in_progress. Treat any other value as final, for example when the task was canceled or you query it more than 24 hours later, so an unexpected state never leaves your client polling forever. Wan progress is coarse: progress can stay at 30% for a while and then jump to 100%.

Models and input modes

The Wan 2.6 models (wan2.6-t2v, wan2.6-i2v, wan2.6-r2v, and wan2.6-r2v-flash) were retired on October 14, 2026. If you still call them, switch to the matching Wan 2.7 model or to Wan 3.0. Model IDs are from LaoZhang API’s public pricing as of October 14, 2026. wan2.7-image-pro is an image model and doesn’t work with this video endpoint.

Request body

Accepted values differ by model. The ranges above come from Alibaba Cloud’s text-to-video API reference. For other models, see the Alibaba Cloud reference for that model (in Chinese):

Media inputs

Every media url must be a public HTTPS link that Alibaba Cloud can fetch directly. Links behind a login or cookies, private-network addresses, and links that expire before the task runs can make the task fail.

Production tips

  • Save the task ID first. Store output.task_id with your own job ID as soon as the create call returns, so a restarted worker resumes polling instead of creating a duplicate task.
  • Check before you retry a create call. Every accepted create request starts a separate task. If a create request times out, check your records and call logs before you send it again.
  • Poll with limits. Check every 5–10 seconds, stop after 20 minutes, and treat any status other than submitted or in_progress as final.
  • Download right away. Alibaba Cloud keeps the task ID and the video URL for 24 hours. Copy the MP4 to your own storage and give users your own URL, not the signed link.
  • Keep inputs reachable. Host media on public HTTPS URLs that stay available until the task finishes.
  • Control cost. Set duration and resolution explicitly, and review each task’s charge in call logs.
  • Use one token per app. A dedicated Wan token for each application or environment keeps logs and charges easy to audit.

Troubleshooting

Frequently asked questions

How much does a 5-second video cost?

At the prices current on October 14, 2026, for a task that only outputs video:
  • wan3.0-video: about $0.51 at 720P, $1.03 at 1080P
  • wan3.0-video-prime: about $0.77 at 720P, $1.54 at 1080P
  • Wan 2.7: about $0.51 at 720P, $0.86 at 1080P
Cost scales with duration, so 10 seconds is about double. Without resolution the task is billed at 1080P, and tasks with input video add the input seconds; see Billing and pricing.

Do I have to send X-DashScope-Async: enable?

Yes, on every create request. Wan’s HTTP API only runs asynchronously, and a create POST without this header fails with current user api does not support synchronous calls. Polling GET /v1/tasks/{task_id} and downloading result_url don’t need it.

What do I get if I leave out resolution and duration?

You get 1080P output. According to Alibaba Cloud’s API references, all four Wan 2.7 models (wan2.7-t2v, wan2.7-i2v, wan2.7-r2v, and wan2.7-videoedit) and Wan 3.0 default to 1080P:
  • Text to video, image to video, and reference to video default to 5 seconds.
  • Wan 2.7 video editing keeps the length of the source video.
A text-to-video task with no parameters is therefore billed as 5 seconds at 1080P:
  • Wan 2.7: about $0.86
  • wan3.0-video: about $1.03
  • wan3.0-video-prime: about $1.54
The examples on this page set 720P explicitly. To keep costs predictable, set resolution and duration on every request and estimate the price from Billing and pricing.

How do I generate a vertical or square video?

Set parameters.ratio for text to video and reference to video; the other tasks follow the shape of their input:
  • Text to video and reference to video: one of the ratios below.
    • 16:9 (the default)
    • 9:16 (at 720P, for example, this produces a 720×1280 video)
    • 1:1
    • 4:3
    • 3:4
  • Image to video: takes no ratio and follows the shape of the first frame.
  • Video editing: keeps the source video’s shape unless you set ratio.
  • Wan 3.0: defaults to adaptive, which picks a ratio from your inputs, and also accepts 21:9.
Price depends only on the resolution tier and the seconds of output, so landscape, portrait, and square videos cost the same at a given tier. For the accepted values per model, see Alibaba Cloud’s text-to-video API reference (in Chinese).

Does the video have sound, and can I make a character speak my audio?

Yes to both. Alibaba Cloud says Wan 2.7 outputs video with sound by default, generating background music, sound effects, or voices to match the picture. To sync lip movement to your own audio, use wan2.7-i2v and add a driving_audio item to input.media[], as in Image to video. The audio must be WAV or MP3 and 2–30 seconds long; anything longer than duration is cut off. Wan 3.0 also outputs sound by default. Send "audio": false for a silent video; the price is the same. Reference to video can reuse the voice from a reference video, and video editing can keep the source video’s original sound. For those parameters, see the Wan 2.7 reference-to-video API reference and the Wan 2.7 video-editing API reference (both in Chinese).

How do I remove the “AI 生成” watermark?

Send "watermark": false in parameters, or leave watermark out, since Alibaba Cloud adds no watermark by default. The examples on this page send true, so their videos carry the watermark in the bottom-right corner; change it before you use the examples in production.

Can I resubmit a task after a client timeout or failure?

Check the task first. A client timeout doesn’t mean the task failed: keep polling the same task_id for up to 24 hours, because a new create request starts a second task that is billed again. Create a new task only after status turns failed or another final value, and fix the request first. Failed tasks aren’t billed, and each task’s actual charge is in call logs. See Billing and pricing and Task statuses.

Why does one task have two charges in my call logs?

The requested length is charged when you create the task, and the charge is settled when the task finishes:
  • If Alibaba Cloud reports the same number of seconds, the log has one charge.
  • If the seconds differ, a second entry (“Wan 任务完成,按实际时长调整”) refunds or charges the difference.
The usual reason is an input video, whose seconds count toward the bill. Wan 3.0 tasks with an input video are charged 30 seconds up front, and the difference is refunded afterward. Add the two entries together for the task’s real cost; see Billing and pricing.

Is a task stuck if progress stays at 30%?

No. The upstream service reports progress in coarse steps, so a pause at 30% is normal. Keep polling while the top-level status is in_progress; see Task statuses.