The wan3.0 series is an all-in-one video generation model, comprehensively upgraded in audio-enabled video generation, multimodal reference, and video editing capabilities. A single generation can be up to 30 seconds long with an output frame rate of 30 fps, and it natively outputs dialogue lines, BGM, and sound effects. A single call supports up to 20 multimodal reference materials (images, videos, audio, documents, and web pages), and supports first-frame/first-and-last-frame control as well as video editing and extension.
For prompt writing, see the Wan3.0 Video Generation Prompt Guide.
Scope
- The models supported vary by region, and resources are independent of each other. For the models supported in each region, see the Model Studio console.
- Before making calls, first obtain and configure an API Key, and then configure the API Key in environment variables. When calling, replace
{WorkspaceId}with your actual workspace ID. - When calling, make sure that the model, Endpoint URL, and API Key all belong to the same region; cross-region calls will fail.
NoteThe example code applies to the Singapore region.
Model Capabilities
wan3.0-video / wan3.0-video-prime are All-in-One models that cover all of the following task types without switching model names. The model routes automatically based on the type field in input.media and the intent of the prompt.
NoteEach task type only supports the type values listed in the table below for that task type, and type values of different task types cannot be mixed. For example, the first-and-last-frame mode only supports first_frame and last_frame, and other types such as reference_audio cannot be passed at the same time. For detailed combination rules, see Material combinations.
Task Type | Trigger Method | Usage Instructions | |
|---|---|---|---|
T2V | Only pass in | Supports freely setting resolution, aspect ratio, and duration | |
I2V | First frame to video | Set | It is recommended to set |
First and last frames to video | Set | It is recommended to set | |
Omni-modal reference | Reference Image | Set | Up to 10 images, each ≤ 20MB |
Reference Video | Set | Up to 5 clips, total duration ≤15 s, single file ≤100MB | |
Audio Reference | Set | Up to 5 clips, total duration ≤15 s, single file ≤15MB | |
Combined reference | Set | Reference images/videos/audio; any combination of the three types of reference materials is supported
| |
File/Web Page reference for video generation | Set | Parses document/web page content to generate videos Document and web page links only support public pages that do not require login | |
Video Editing | Set | Add, remove, or modify elements; style transfer; lighting editing; dialogue editing. For | |
Video extension | Set | Forward/backward/bidirectional extension. For | |
Prompt Tips
The platform provides the Wan 3.0 prompt optimization Skill to help you tune and optimize your prompts.
Download the Skill: wan3-pe.zip (extract it after downloading)
Usage: Enter /wan3-pe + your prompt content in the AI chat box to start debugging your prompt. For example:
/wan3-pe 基于skill对提示词进行完善,提示词为:一只猫在草地上奔跑
Key Features
Text-to-Video
Generates videos from prompts only, without passing in any media files. Natively supports multi-shot narratives up to 30 seconds long, with automatically generated synchronized dialogue, BGM, and sound effects.
- Supports single-shot and multi-shot storyboard formats (4~6 seconds per shot, with timestamp annotations).
- Videos with audio: natively generates voice dialogue, ambient sound effects, and background music, no post-production dubbing required.
- Smart duration: when
durationis set to-1, the model automatically recommends an appropriate duration.
Parameter settings: resolution=480P/720P/1080P (default), ratio=21:9/16:9/4:3/1:1/3:4/9:16, duration=2~30 seconds or -1 (smart duration).
Example 2 prompt
Story synopsis
This is a "refueling" incident full of deadpan humor and absurdity, set on a brightly colored futuristic wasteland. At a forgotten gas station resembling those along Route 66, a bored attendant welcomes an odd customer—a cool cowgirl riding a real horse. Just as the attendant assumes she is merely a passing lunatic, the cowgirl walks straight up to the fuel pump, takes the nozzle, and "fills up" her horse with fresh green grass. This surreal scene leaves the well-traveled attendant frozen in a state of cognitive dissonance.
Scene description and lighting aesthetics
Visual style: realistic style, with high-saturation, high-brightness cinematic color grading that creates a "sunny" feel, placing this absurd story in an utterly normal, even somewhat beautiful environment.
Color aesthetics: strictly follow the bright "teal and orange" palette.
Teal: the cloudless sky is a bright, clear azure (leaning cyan). The main building of the gas station uses a retro yellow-orange-blue color scheme, slightly faded. The fuel pump is a faded retro red.
Orange: the ground is cracked, parched orange earth. The distant mountains show warm terracotta tones. The cowgirl's scarf or jacket is orange.
Characters and setting:
Cowgirl: cool and taciturn. Wears a wide-brimmed cowboy hat. Dressed in hard-wearing work boots and jeans, with traces of dust from long-distance travel on her.
Horse: a real horse with a calm demeanor and ordinary coat color, as if it has long been used to all this.
Gas station attendant: wears greasy blue overalls and an enormous pair of black sunglasses, lounges lazily in a chair with a toothpick in his mouth. He is the core "reaction shot" of this film.
Gas station: classic Route 66 style, with a small convenience store next to it and a faded Coca-Cola vending machine at the door, full of American retro charm.
- Camera movement style description
The camera movement style is "Calm Observation & Absurd Close-up":
Extensive use of fixed medium shots and slow pans to record the event from a very calm, objective perspective, with no emotional guidance at all.
When a key absurd action occurs, the camera suddenly cuts to an extreme close-up—for example, the moment grass sprays from the fuel nozzle, or the attendant's blank facial expression—creating humor through this abrupt magnification.
- Storyboard description
0s - 8s: Prologue: A boring afternoon
Extreme long shot (fixed). Blue sky, blowing sand. A retro yellow-orange-blue gas station, slightly faded, stands alone by the highway. At the station entrance, an attendant wearing sunglasses dozes lazily in a chair. Everything is so quiet that only the wind can be heard.
Long shot. On the horizon, a cowgirl on horseback slowly appears, breaking the tranquility.
Medium shot. The attendant is startled awake by the sound of hooves. He adjusts his sunglasses, sits up impatiently, and stares at this strange pair; the toothpick in his mouth shifts, and his face reads "another one asking for directions".
8s - 16s: Subversion: Deadpan mischief
Without a word, the cowgirl deftly dismounts, leads her horse, and walks straight up to an old-fashioned fuel pump. The horse skillfully stretches its head beside the pump.
POV of the attendant (slightly fisheye): the camera mimics his view from behind the sunglasses, making the pairing of woman and horse look even more bizarre. He sees the cowgirl actually pick up the fuel nozzle.
Close-up. The attendant's brow furrows; he thinks this woman is messing with him. He takes off his sunglasses, ready to snap at her.
Slow-motion close-up: the instant he removes his sunglasses, he sees the cowgirl aim the nozzle at the horse's mouth and pull the trigger.
16s - 24s: Urgent: 【Climax】 The moment of cognitive collapse
【Ultimate contrast】:
Close-up: the fuel nozzle. Instead of gasoline, it sprays fresh, emerald-green blades of grass still dotted with water droplets!
Extreme close-up: the shot cuts quickly to the stunned attendant's face. His eyes are wide as saucers, his mouth hangs slightly open, and the toothpick clamped in his lips has frozen mid-fidget. His expression is locked, as if his entire worldview has been shattered in this very second.
Medium shot. The horse munches away contentedly, eyes narrowed in bliss, then gives a satisfied, forceful flick of its tail. The dust swept up by the tail lands right in the face of the still-dazed attendant standing nearby.
24s - 30s: Wrap-up: she rides off in a cloud of dust, leaving him stunned.
"Filled up" with grass. The cowgirl hangs the fuel nozzle back in place. She fishes a few coins out of her pocket, walks to the convenience store entrance, and drops them - clink, clink, clank - into a tin can sitting on the counter.
She glances back at the attendant, still petrified, and the corner of her mouth beneath the brim of her hat seems to curl up ever so slightly.
【Final freeze-frame】: She swings onto the horse and gallops away, leaving a trail of dust.
The camera slowly pushes in on the attendant. He is still holding that dumbstruck pose, face covered in dust, the sunglasses he just took off still clutched in his hand, until the toothpick in his mouth finally falls to the ground with a "clack".
The frame freezes on his dumbfounded face, and the film ends in an absurd silence, leaving only the sound of the toothpick rolling across the ground as a gust of wind passes by.
Prompt for example 3
3D animated short film, 30 seconds, dark fantasy theme, single shot, dim stone-brick interior. A coldly handsome man with violet eyes, disheveled hair streaked ink-blue and silver, obsidian crystal horns, and pale, cool skin; dark-purple star-orbit arcane patterns cover his temples. He wears a midnight-blue brocade high-collar coat over a black silk shirt, with a dark-silver amethyst ear cuff on his left ear.
Scene: night, dominated by hard, cold-white moonlight; high-contrast, low-key lighting with a front-side light effect; two blurred figures and flickering warm-yellow firelight in the background; ghostly blue dust particles drifting in the air.
Camera: medium close-up at a slight downward angle, shallow depth of field locked on the figure on the left, tilting up extremely slowly to eye level as the monologue unfolds.
Action: the man stands at an angle, head lowered in a contemptuous smile; he glances sideways at his palm, then turns toward the camera, lifts his head, and says in a cold, magnetic voice: "Ripe enough for the void." His left hand spreads its five fingers as a shadow nebula vortex condenses in his palm, and he says: "Your soul, a mere spark for me to extinguish." He suddenly clenches his fist; the nebula bursts and dissolves into dark-purple mist and ghostly blue stardust, finally revealing a cruel smile, his dark-purple gradient nails slightly splayed.
Paired with void-resonance sound effects and energy-rupture sounds; a young villain's English voice-over runs throughout.
Python SDK
ImportantUpdate the DashScope Python SDK to 2.0.1 or later before running the following code. For update instructions, see Install the SDK.
import os
import dashscope
from dashscope import DashScopeError
# The following is the configuration for the Singapore (ap-southeast-1) region. Replace {WorkspaceId} with your Model Studio workspace ID. The region value varies by region.
client = dashscope.Client(
api_key=os.getenv("DASHSCOPE_API_KEY"),
workspace="{WorkspaceId}",
region="ap-southeast-1",
)
print('please wait...')
# generate is a one-step call (submits the task and waits for completion) that returns a completed Job
try:
job = client.videos.generate(
model='wan3.0-video',
prompt='20秒超宽银幕毛绒宇宙冒险片段,整体采用超精细毛绒材质、电影级太空尺度、可爱外形与强烈动作反差、夸张FPV运镜和真实软体物理。一艘由毛绒布、纽扣、拉链与填充棉制成的宇宙飞船,载着兔子、狐狸和乌鸦三只小型毛绒动物,在由巨大毛线行星、绒毛星云和布偶巨兽组成的宇宙中高速逃亡。一只覆盖深蓝长绒毛、眼睛像两枚玻璃纽扣的巨大星际鲸兽从星云中追赶飞船。动态包括拉链飞船弹射起航、贴着毛线行星高速绕行、巨鲸从后方冲出、穿越纽扣小行星带、被鲸兽吞入体内、沿金色拉链从背部逃出、巨鲸如泄掉填充棉般缓慢变扁、最终穿越粉紫色绒毛星云向彩色纽扣太阳飞去。',
resolution="480P",
ratio="adaptive",
duration=20,
prompt_extend=True)
print(job)
print("video_url:", job.video_url)
except DashScopeError as e:
print(f"HTTP status code: {e.status_code}")
print(f"Error code: {e.code}")
print(f"Error message: {e.message}")
print("See the documentation: https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
Java SDK
ImportantUpdate the DashScope Java SDK to 2.22.31 or later before running the following code. For update instructions, see Install the SDK.
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
public class Text2Video {
static {
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void syncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan3.0-video")
.prompt("20秒超宽银幕毛绒宇宙冒险片段,整体采用超精细毛绒材质、电影级太空尺度、可爱外形与强烈动作反差、夸张FPV运镜和真实软体物理。一艘由毛绒布、纽扣、拉链与填充棉制成的宇宙飞船,载着兔子、狐狸和乌鸦三只小型毛绒动物,在由巨大毛线行星、绒毛星云和布偶巨兽组成的宇宙中高速逃亡。")
.resolution("480P")
.ratio("adaptive")
.duration(20)
.promptExtend(true)
.build();
VideoSynthesisResult result = null;
try {
System.out.println("---sync call, please wait a moment----");
result = videoSynthesis.call(param);
} catch (ApiException | NoApiKeyException e) {
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
syncCall();
}
}
curl
Step 1: Create a task to get the task IDcurl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "20秒超宽银幕毛绒宇宙冒险片段,整体采用超精细毛绒材质、电影级太空尺度、可爱外形与强烈动作反差、夸张FPV运镜和真实软体物理。一艘由毛绒布、纽扣、拉链与填充棉制成的宇宙飞船,载着兔子、狐狸和乌鸦三只小型毛绒动物,在由巨大毛线行星、绒毛星云和布偶巨兽组成的宇宙中高速逃亡。一只覆盖深蓝长绒毛、眼睛像两枚玻璃纽扣的巨大星际鲸兽从星云中追赶飞船。动态包括拉链飞船弹射起航、贴着毛线行星高速绕行、巨鲸从后方冲出、穿越纽扣小行星带、被鲸兽吞入体内、沿金色拉链从背部逃出、巨鲸如泄掉填充棉般缓慢变扁、最终穿越粉紫色绒毛星云向彩色纽扣太阳飞去。"
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 20,
"prompt_extend": true
}
}'
Step 2: Get the result by task IDcurl -X GET 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
I2V (First Frame / First and Last Frames)
Use first_frame/last_frame to strictly specify the video's first or last frame image, reproducing the reference image at the pixel level. Suitable for scenarios that require precise control of the start and end frames.
- First-frame-to-video: pass in one image as the video's first frame, and the model generates the subsequent motion.
- First-and-last-frame-to-video: specify both the first and last frames, and the model automatically generates the transitional motion in between.
- Supports audio-enabled video output; you can specify dialogue lines and sound effects in the prompt.
Parameter settings: ratio is recommended to be set to adaptive (automatically matches the aspect ratio of the input image), and duration=2~30 s or -1.
| Capability | Input prompt | Input first or last frame | Output video |
First frame to video | (0:00 - 0:03) Camera: medium shot. Visual: continues the ink-wash bamboo grove scene from Image 1. A swordsman wearing a bamboo hat and an ink-black robe stands silhouetted at the center, surrounded by dense fog amid swaying bamboo shadows. Action: the swordsman lightly rests his left hand on the hilt of his blade as bamboo leaves drift down in the wind. Mood: silent and oppressive, with the grain of the ink-wash diffusion clearly visible.
| ![]() | |
First and last frames to video | One continuous shot, slow aesthetic camera movement, no cuts, a 15-second long take, a collision between the mineral-pigment texture of Chinese rock-color painting and 3D rendering, a striking azure-blue × gilded-gold color clash
| First Frame ![]() End Frame ![]() |
Prompt: first frame to video
(0:00 - 0:03) Camera: medium shot. Visual: continues the ink-wash bamboo grove scene from Image 1. A swordsman wearing a bamboo hat and an ink-black robe stands silhouetted at the center, surrounded by dense fog amid swaying bamboo shadows. Action: the swordsman lightly rests his left hand on the hilt of his blade as bamboo leaves drift down in the wind. Mood: silent and oppressive, with the grain of the ink-wash diffusion clearly visible.
(0:03 - 0:08) Plot introduction; camera movement: close-up. Plot: the swordsman senses killing intent. Visuals: the camera rapidly pushes in to a close-up beneath the swordsman's bamboo hat. Details: beneath the brim of the hat, a pair of sharp, resolute eyes appears, the gaze like a blade. An ink-wash "sweat drop" slides down from his forehead. Action: the swordsman's right hand slowly tightens around the hilt until his knuckles whiten. The bamboo leaves fall faster.
(0:08 - 0:13) Camera movement: rapid orbit. Visuals: the camera rapidly circles around the swordsman. Plot: two assassins, likewise rendered as ink-wash silhouettes, charge out from deep in the bamboo grove, wielding twin hooks and short blades. Details: the assassins' movements are also formed of ink brushstrokes, flowing like ink traces. The camera sweeps quickly past the assassins' figures, emphasizing the sense of speed.
(0:13 - 0:18) Camera movement: handheld feel, high-speed capture. Combat: the swordsman suddenly draws his blade; the flash of the blade is a pure-white ink-wash fissure. The assassins strike with their twin hooks. Details: First strike: the swordsman turns and slashes; his blade collides with the assassins' twin hooks, bursting into countless black-and-white sparks and ink dots with a calligraphic feel. Second strike: the swordsman feints, uses a bamboo pole to catapult himself, and cleaves down from above; the assassins tumble out of the way, and the bamboo pole snaps, turning into scattering ink marks. Third strike: the swordsman points his blade tip straight at the other assassin's throat; the assassin parries with a short blade, and the camera captures the fine details of ink cracking as the blade grinds against the short blade.
(0:18 - 0:20) Camera movement: slow motion into a freeze frame. * Visuals: The swordsman's blade stops beside the assassin's neck, and the assassin freezes. * Details: The swordsman's bamboo hat has tilted slightly during the fight. The bamboo grove settles back into calm as more bamboo leaves flutter. * Atmosphere: The camera slowly pulls back into a medium shot, freezing on the swordsman sheathing his blade and the assassin collapsing to the ground. * Text (optional): Ink-wash style text appears at the bottom of the frame: "The jianghu — all written off with a single stroke." Style notes: Throughout, maintain the highly black-and-white ink-wash painting style of Image 1; the action must carry a brushstroke feel, the speed must be fast, and the details must be plentiful (ink droplets, sparks, ink-fissure marks).
Prompt: first and last frame to video
One continuous shot, slow aesthetic camera movement, no cuts, a 15-second long take, a collision between the mineral-pigment texture of Chinese rock-color painting and 3D rendering, a striking azure-blue × gilded-gold color clash
Global settings: Chinese-style rock-color painting texture, granular mineral-pigment grain, gold-foil texture, and a strong color clash between azure blue and gilded gold. The scene is West Lake in the early-morning mist: the lake surface is rendered in matte azure washes, golden morning light pierces the clouds to form Tyndall light pillars, and in the distance the stone pagodas of Three Pools Mirroring the Moon and Leifeng Pagoda loom faintly through the mist, with lotus leaves and lotus blossoms in the foreground. The subject of the frame is the West Lake water goddess "Xizi": rock-color painting texture, an oval face, willow-leaf eyebrows, phoenix eyes, a dot of cinnabar forehead ornament between her brows, skin like mutton-fat white jade glowing softly, and a pale-gold circular halo suspended behind her head; her hair is coiled high and pinned with a gilded lotus hairpin, and her skirt and shawl are formed of flowing lake water in an azure-blue gradient, their surfaces shimmering with light.
Voiceover and sound effects: gentle guzheng and bamboo flute in the background, with subtle lapping water and early-morning birdsong as ambience. From the 8th second, an ethereal, tender female voice recites slowly: "If West Lake were compared to Xizi—"; during the look-back segment, the second half of the line follows: "In light or heavy makeup, she is equally lovely." The pacing is slow, with a slight echo and a long, lingering resonance.
[0-3 s: A drop of water] Extreme macro close-up: at the edge of a lotus leaf in the early morning, a water droplet swells to fullness, reflecting the golden morning light, and slowly falls. The camera tilts down (Tilt down) following the droplet; the drop falls into the lake and stirs up a ring of gold-and-blue ripples that spread outward layer by layer.
[3-7 s: Water gathering into form] At the center of the ripples, the lake water slowly rises and condenses into the figure of the goddess "Xizi": the lake water turns into her azure-blue skirt and translucent shawl, with fine streams of water flowing around her body. She rises slowly from the heart of the lake, her eyes gently closing and then slowly opening, and the gilded lotus hairpin lights up with a faint glow. The camera slowly orbits (Orbit) her half-lowered eyes and the skirt woven from flowing water.
[7-11 s: A lotus at every step] She walks forward slowly, barefoot on the lake surface; with each step, a ring of golden ripples spreads out beneath her feet, and lotus flowers bloom one after another within the ripples. The camera pulls back and away into a medium-wide shot: the thin mist disperses, the three stone pagodas of Three Pools Mirroring the Moon light up with warm glows in the distance, Leifeng Pagoda emerges in the morning light, and the weeping willows on the shore brush the water. At the 8th second, the female voiceover begins: "If West Lake were compared to Xizi—" Her shawl trails a long stretch of gold-and-blue water light behind her.
[11-15 s: The look back, always lovely] She stops, looks back toward the camera, and the camera slowly pushes in to a half-body close-up: morning light falls on her face, the lake-water shawl flutters gently at her side, and a few glowing droplets fall from the tips of her hair, dissolving into fine points of light in the air. The voiceover picks up the second half of the line: "In light or heavy makeup, she is equally lovely." She smiles faintly, with Leifeng Pagoda in the morning light and the misty Three Pools Mirroring the Moon behind her. In the final second, the frame freezes entirely on her look-back close-up, locked into a perfect movie-poster composition.
Python SDK
ImportantUpdate the DashScope Python SDK to 2.0.1 or later before running the following code. For update instructions, see Install the SDK.
import os
import dashscope
from dashscope import DashScopeError
# The following is the configuration for the Singapore (ap-southeast-1) region. Replace {WorkspaceId} with your Model Studio workspace ID. The region value varies by region.
client = dashscope.Client(
api_key=os.getenv("DASHSCOPE_API_KEY"),
workspace="{WorkspaceId}",
region="ap-southeast-1",
)
print('please wait...')
# generate is a one-step call (submits the task and waits for completion) that returns a completed Job
try:
job = client.videos.generate(
model='wan3.0-video',
prompt='一只猫在草地上奔跑',
media=[{"type": "first_frame", "url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"}],
resolution="720P",
ratio="adaptive",
duration=5,
prompt_extend=True)
print(job)
print("video_url:", job.video_url)
except DashScopeError as e:
print(f"HTTP status code: {e.status_code}")
print(f"Error code: {e.code}")
print(f"Error message: {e.message}")
print("See the documentation: https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
Java SDK
ImportantUpdate the DashScope Java SDK to 2.22.31 or later before running the following code. For update instructions, see Install the SDK.
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class FirstFrame2Video {
static {
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void syncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
List<VideoSynthesisParam.Media> media = new ArrayList<>();
media.add(VideoSynthesisParam.Media.builder()
.url("https://cdn.translate.alibaba.com/r/wanx-demo-1.png")
.type("first_frame")
.build());
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan3.0-video")
.prompt("一只猫在草地上奔跑")
.media(media)
.resolution("720P")
.ratio("adaptive")
.duration(5)
.promptExtend(true)
.build();
VideoSynthesisResult result = null;
try {
System.out.println("---sync call, please wait a moment----");
result = videoSynthesis.call(param);
} catch (ApiException | NoApiKeyException e) {
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
syncCall();
}
}
curl
Step 1: Create a task to get the task IDcurl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "一只猫在草地上奔跑",
"media": [
{
"type": "first_frame",
"url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
}
]
},
"parameters": {
"resolution": "720P",
"ratio": "adaptive",
"duration": 5,
"prompt_extend": true
}
}'
Step 2: Get the result by task IDcurl -X GET 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
All-Modality Reference-to-Video
You can input up to 20 reference assets (images, videos, audio, documents, and web pages), and the model automatically understands the reference intent to generate a video. In the prompt, use "Image 1" or "image 1", "Video 1", "Audio 1", and so on to refer to the assets at the corresponding positions in the input.media array.
NoteAsset reference rules: images, videos, and audio are counted separately. The 1st reference_image in the input.media array corresponds to "image 1" or "Image 1" in the prompt, and the 2nd corresponds to "image 2" or "Image 2"; the 1st reference_video corresponds to "Video 1", and the 2nd to "Video 2"; the 1st reference_audio corresponds to "Audio 1", and the 2nd to "Audio 2", and so on. The three do not conflict with one another — "image 1", "Video 1", and "Audio 1" can coexist.
- Character/object reference: pass in images of a character or object to generate a video with consistent appearance.
- Camera movement/action reference: pass in a reference video to replicate its camera movement or action choreography.
- Style reference: pass in a style reference image to apply its aesthetic style to the generated video.
- Audio reference: pass in music or speech to generate dance or lip-sync animation synchronized to the beat or intonation.
- Document/web page to video: pass in a document or a public web page link; the content is automatically parsed to generate a video.
Parameter settings: ratio is recommended to be set to adaptive (adaptive to the reference assets), and duration to 2~30 s or -1.
1. Reference image/video/audio
| Capability | Input prompt | Input reference assets | Output video |
Reference image | Use the lip gloss product image in Image 1 to generate a model lip-swatch video, 15 s, vertical orientation, highlighting the lip-color effect | ![]() | |
Reference image + video + audio | Seamlessly replace the female character in Video 1 with the male character from Image 1. The character sits by the window, holding a phone to their ear and talking. Voice and lines: Extract the timbre features from Audio 1 and have the character deliver the following lines: "Really? That sounds great! When are you coming back? I miss you so much." Lip sync and expression: The generated speech must precisely drive the character's lips to open and close naturally. While speaking, there should be natural blinking, slight head nods, and a sense of breathing; the facial micro-expressions must perfectly match the caring, reminiscent emotions of the lines. Lighting and scene: The character's face should be naturally lit by a blend of warm indoor light and cool neon light from outside the window. In the background, raindrops keep sliding slowly down the window; the coffee on the table gives off a faint rising steam; the character and the scene blend naturally at the edges, with no cutout traces. Camera and image quality: A 15 s long take, with the camera pushing forward extremely slowly, an extremely stable frame, cinematic lighting, 8K resolution, and a photorealistic look. | Reference image ![]() Reference Video Reference Audio |
Python SDK
ImportantUpdate the DashScope Python SDK to 2.0.1 or later before running the following code. For update instructions, see Install the SDK.
import os
import dashscope
from dashscope import DashScopeError
# The following is the configuration for the Singapore (ap-southeast-1) region. Replace {WorkspaceId} with your Model Studio workspace ID. The region value varies by region.
client = dashscope.Client(
api_key=os.getenv("DASHSCOPE_API_KEY"),
workspace="{WorkspaceId}",
region="ap-southeast-1",
)
print('please wait...')
# generate is a one-step call (submits the task and waits for completion) that returns a completed Job
try:
job = client.videos.generate(
model='wan3.0-video',
prompt='视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:"今天的阳光真好。"图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:"真好听,能不能再唱一遍"。',
media=[
{"type": "reference_image", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/sjuytr/wan-r2v-object-girl.jpg"},
{"type": "reference_video", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4"},
{"type": "reference_image", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/rtjeqf/wan-r2v-object3.png"},
{"type": "reference_image", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png"},
{"type": "reference_image", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"}
],
resolution="720P",
ratio="adaptive",
duration=5,
prompt_extend=True)
print(job)
print("video_url:", job.video_url)
except DashScopeError as e:
print(f"HTTP status code: {e.status_code}")
print(f"Error code: {e.code}")
print(f"Error message: {e.message}")
print("See the documentation: https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
Java SDK
ImportantUpdate the DashScope Java SDK to 2.22.31 or later before running the following code. For update instructions, see Install the SDK.
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class Reference2Video {
static {
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void syncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
List<VideoSynthesisParam.Media> media = new ArrayList<>();
media.add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/sjuytr/wan-r2v-object-girl.jpg")
.type("reference_image")
.build());
media.add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4")
.type("reference_video")
.build());
media.add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/rtjeqf/wan-r2v-object3.png")
.type("reference_image")
.build());
media.add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png")
.type("reference_image")
.build());
media.add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png")
.type("reference_image")
.build());
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan3.0-video")
.prompt("视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:\"今天的阳光真好。\"图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:\"真好听,能不能再唱一遍\"。")
.media(media)
.resolution("720P")
.ratio("adaptive")
.duration(5)
.promptExtend(true)
.build();
VideoSynthesisResult result = null;
try {
System.out.println("---sync call, please wait a moment----");
result = videoSynthesis.call(param);
} catch (ApiException | NoApiKeyException e) {
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
syncCall();
}
}
curl
Step 1: Create a task to get the task IDcurl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "视频1抱着图3,在图4的椅子上弹奏一支舒缓的乡村民谣,并说道:\"今天的阳光真好。\"图1手中拿着图2,路过视频1,把手中的图2放到视频1旁边的桌子上,并说道:\"真好听,能不能再唱一遍\"。",
"media": [
{"type": "reference_image", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260408/sjuytr/wan-r2v-object-girl.jpg"},
{"type": "reference_video", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4"},
{"type": "reference_image", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/rtjeqf/wan-r2v-object3.png"},
{"type": "reference_image", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png"},
{"type": "reference_image", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"}
]
},
"parameters": {
"resolution": "720P",
"ratio": "adaptive",
"duration": 5,
"prompt_extend": true
}
}'
Step 2: Get the result by task IDcurl -X GET 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
2. Reference file or web page
| Capability | Input prompt | Input material | Output video |
Reference file - Generate video from PPT | A high-end smart glasses product advertisement with an overall minimalist, futuristic, stylish, and premium feel, restrained lighting, and a palette dominated by black, silver-gray, and ice blue, accented locally with soft white light and parameter UI graphics.
| ||
Reference file - Generate video from Excel | Total duration 22 seconds, 4 clips spliced in sequence. The entire video uses a pure white background, soft color blocks, and clean line charts, in an Apple Keynote-style minimalist business style, with dark gray sans-serif fonts.
|
Prompt: Reference file - Generate video from PPT
An advertisement for high-end smart glasses with an overall minimalist, futuristic, stylish, and premium style, restrained lighting, and a palette dominated by black, silver-gray, and ice blue, accented locally with soft white light and parameter UI graphics. The opening shows a pair of smart glasses slowly emerging from the darkness against a pure black background, refined highlights sweeping across the temple edges, and the frame outline traced by cold rim light. The camera glides at an ultra-close distance over the lenses, nose pads, hinges, temples, and material details, revealing the fine texture of metal and high-performance composite materials, with a premium, restrained surface finish and thin, smooth lines. The product then slowly rotates in mid-air while the screen displays core parameter information in sync with minimalist motion graphics. The camera then rapidly pulls together as all parts precisely return and assemble into the complete product, switching to a young model wearing the glasses — the model has well-defined features and a confident air, dressed in simple, premium urban fashion, naturally turning, raising a hand, walking, and smiling in a minimalist space and urban light-and-shadow environment. The camera shows the glasses being worn from the front, side, and three-quarter rear views, highlighting the thin, snug fit, fashionable silhouette, and everyday versatility. The ending shows the product floating and frozen against a solid-color background as the camera slowly pushes in to the brand logo and core slogan. The music is minimalist electronic ambiance with precise drum beats, a clean and powerful rhythm, and the visuals are premium, restrained, and pure, with strong brand memorability and an international tech aesthetic.
Prompt: Reference file - Generate video from Excel
Total duration 22 seconds, 4 clips spliced in sequence. The entire video uses a pure white background, soft color blocks, and clean line charts, in an Apple Keynote-style minimalist business style, with dark gray sans-serif fonts. BGM (mandatory, running through the entire video, clearly audible): an upbeat business background track with a steady beat and a simple melody; music starts from the very first second, runs uninterrupted throughout, and when narration appears the music does not disappear but sits slightly below the voice. Sound effects layer: a 'whoosh' as color blocks slide in, a light keyboard 'click' as numbers jump, and a crisp 'ding' bell when key data pops up. Narration: an English male or female voice, bright and confident, at about 2.5 words per second, like presenting at a quarterly meeting — professional but not cold, with rhythm and slight emphasis on key numbers.
H1-2026 cross-border e-commerce monthly GMV.xlsx
Clip 1: wide shot, centered composition, pure white background, soft light, minimalist business style, visually referencing the clean white background + soft color blocks of reference image 1. The pure white frame unfolds from the center as countless golden light particles converge from all edges toward the center; after the particles collide and sparkle, they condense into the title text 'H1 2026 · Wan', the text surface shimmering with a flowing data-stream light effect and faint particles continually drifting around its edges — cool and premium overall. After lingering briefly, the title dissolves into a stream of particles while two groups of large dark-gray numbers slide in below — on the left the value of cell B7 in row 7, $1,580 (January GMV), and on the right the value of cell G7, $3,460 (June GMV), connected by a light gray arrow, with the small light-gray text 'Monthly GMV Growth' floating beneath the arrow. A coral rounded label pops up at the bottom showing the value of cell H8 in row 8, +45.7% (overall H1 growth), accompanied by a crisp 'ding'. The narration says briskly and confidently: 'In the first half of 2026, monthly GMV grew from 15.8 to 34.6 million dollars.' The BGM is clearly audible from the first second of the frame, with an upbeat beat throughout and a light 'whoosh' as the color blocks slide in. At the end of the clip, the blocks slide smoothly apart to reveal the next scene.
Clip 2: wide shot, left Y-axis + bottom X-axis composition, pure white background with a light gray dotted grid, soft light, minimalist business style, visually referencing the trend-line chart style of reference image 2. The bottom X-axis is clearly labeled from left to right with six month labels: Jan, Feb, Mar, Apr, May, Jun, evenly spaced in light gray sans-serif type. The left Y-axis shows value ticks. Three trend lines are drawn simultaneously from left to right — coral for Southeast Asia (data from row 4: B4=$580, C4=$640, D4=$750, E4=$880, F4=$1,050, G4=$1,280), teal for North America (row 5: B5=$420, C5=$480, D5=$560, E5=$680, F5=$860, G5=$1,260), and amber for Europe (row 6: B6=$580, C6=$610, D6=$680, E6=$750, F6=$830, G6=$920). All three lines start at the same position at Jan and extend up to the right in rhythm to Jun. Below each line is a gradient fill at 30% opacity. As each month's node is reached, the data point bounces lightly and a precise value label floats directly above it — labels show only the dollar value, no percentages or other text, and the values must exactly match the cells above. A legend slides out in the upper-right corner: three color blocks with the market names in English. After all six points are reached, the frame holds for a moment. The narration says with a steady rhythm: 'All three markets — Southeast Asia, North America, and Europe — showed consistent month-over-month growth, with no single dip.' The BGM remains audible, with a fine 'click' keyboard sound as numbers pop up. The June end-point label enlarges to fill the frame, then shrinks and regroups, transitioning to the next segment.
Clip 3: wide shot, 60% bar chart on the left + 40% data column on the right, pure white background, soft light, minimalist business style, visually referencing the bar chart style of reference image 1. Six teal rounded bars rise from left to right on the white background, corresponding to January through June — all 6 bars must be shown in full, with heights strictly matching the monthly North America values in row 5: B5=$420, C5=$480, D5=$560, E5=$680, F5=$860, G5=$1,260, rising from low to high to show a clear month-over-month growth trend. Each bar rises with a slight 'whoosh' elastic sound effect, and a precise dollar value label floats above its top. Once all bars are in place, five North America month-over-month growth rates slide out in a vertical column on the right, each calculated from two adjacent months: Feb +14.3% (C5 vs B5), Mar +16.7% (D5 vs C5), Apr +21.4% (E5 vs D5), May +26.5% (F5 vs E5), Jun +46.5% (G5 vs F5). Each growth rate appears as: an emerald up-arrow icon + the percentage value (e.g. ↑+14.3%), arranged in a staircase from top to bottom; the green arrows emphasize the growth trend, with slightly larger type for legibility. Each number slides in with a fine 'click'. Finally, North America's overall growth pops out in the center in large coral type: +200% (calculated as G5=$1,260 vs B5=$420), accompanied by a crisp 'ding' bell; it lingers briefly with a faint glow around the number. The narration adds slight emphasis at the key data: 'North America was our growth engine — up two hundred percent in just six months, accelerating every single month.' The BGM stays clear, with the rhythm building toward a climax. The overall growth figure enlarges at center as the surrounding elements softly fade out, transitioning to the final segment.
Clip 4: wide shot, centered composition slightly high, pure white background, soft light, minimalist business style, visually referencing the donut chart style of reference image 3. A minimalist donut chart appears at the center of the white background with only three arcs, rendering the H1 share of the three markets in coral, teal, and amber — Southeast Asia's share is calculated from H4=5180, North America's from H5=4260, and Europe's from H6=4370, with a total of H7=13810. White gaps separate the three arcs; the donut chart is clean and simple, with no percentage symbols, no numeric annotations, and no scattered labels — only the pure three colored arcs. The donut rotates slowly at about 10°/s. At the very center of the donut a large dark-gray number rapidly counts up from 0 to the value of cell H7, $138.1M (i.e., 138.10 million US dollars), accompanied by continuous fine 'click' sounds, with a final crisp 'ding' as the number settles. Below, a light-gray subtitle fades in: 'Three Markets · All Growing · Zero Downturn'. The narration closes in a steady tone, leaving 1 second of silence after it ends: '138 million in total — all markets growing, zero downturns.' The BGM remains audible, slowly decaying at the end; after 1 second of silence the video ends.
Python SDK
ImportantUpdate the DashScope Python SDK to 2.0.1 or later before running the following code. For update instructions, see Install the SDK.
import os
import dashscope
from dashscope import DashScopeError
# The following is the configuration for the Singapore (ap-southeast-1) region. Replace {WorkspaceId} with your Model Studio workspace ID. The region value varies by region.
client = dashscope.Client(
api_key=os.getenv("DASHSCOPE_API_KEY"),
workspace="{WorkspaceId}",
region="ap-southeast-1",
)
print('please wait...')
# generate is a one-step call (submits the task and waits for completion) that returns a completed Job
try:
job = client.videos.generate(
model='wan3.0-video',
prompt='一支高端智能眼镜产品广告,整体风格极简、未来感、时尚高级,光影克制,画面以黑色、银灰色、冰蓝色为主色调,局部点缀柔和白光与参数UI图形。开场在纯黑背景中,一副智能眼镜从黑暗中缓缓浮现,镜腿边缘掠过精致高光,镜框轮廓在冷冽边缘光下被勾勒出来,镜头超近距离掠过镜片、鼻托、转轴、镜腿与材质细节,展现金属与高性能复合材料的细腻质感,表面处理高级克制,线条轻薄流畅。随后产品在空中缓慢旋转,画面以极简动态图形同步展示核心参数信息。随后镜头快速收拢,所有零件精准回归组装成完整产品,切换到年轻模特佩戴展示,模特五官立体、气质自信,穿着简洁高级的都市时尚服装,在极简空间和城市光影环境中自然转头、抬手、行走、微笑,镜头从正面、侧面、斜后方展示眼镜佩戴状态,突出轻薄贴合、时尚轮廓与日常百搭属性。结尾在纯色背景中,产品悬浮定格,镜头缓慢推进到品牌logo和核心slogan,整体音乐极简电子氛围配合精准鼓点,节奏干净有力,画面质感高级、克制、纯粹,具有强烈品牌记忆点和国际化科技审美。',
media=[
{"type": "file", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260806/ebapmr/glass.pptx"}
],
resolution="480P",
ratio="adaptive",
duration=10,
prompt_extend=True)
print(job)
print("video_url:", job.video_url)
except DashScopeError as e:
print(f"HTTP status code: {e.status_code}")
print(f"Error code: {e.code}")
print(f"Error message: {e.message}")
print("See the documentation: https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
Java SDK
ImportantUpdate the DashScope Java SDK to 2.22.31 or later before running the following code. For update instructions, see Install the SDK.
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class File2Video {
static {
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void syncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
List<VideoSynthesisParam.Media> media = new ArrayList<>();
media.add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260806/ebapmr/glass.pptx")
.type("file")
.build());
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan3.0-video")
.prompt("一支高端智能眼镜产品广告,整体风格极简、未来感、时尚高级,光影克制,画面以黑色、银灰色、冰蓝色为主色调。")
.media(media)
.resolution("480P")
.ratio("adaptive")
.duration(10)
.promptExtend(true)
.build();
VideoSynthesisResult result = null;
try {
System.out.println("---sync call, please wait a moment----");
result = videoSynthesis.call(param);
} catch (ApiException | NoApiKeyException e) {
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
syncCall();
}
}
curl
Step 1: Create a task to get the task IDcurl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "一支高端智能眼镜产品广告,整体风格极简、未来感、时尚高级,光影克制,画面以黑色、银灰色、冰蓝色为主色调,局部点缀柔和白光与参数UI图形。开场在纯黑背景中,一副智能眼镜从黑暗中缓缓浮现,镜腿边缘掠过精致高光,镜框轮廓在冷冽边缘光下被勾勒出来,镜头超近距离掠过镜片、鼻托、转轴、镜腿与材质细节,展现金属与高性能复合材料的细腻质感,表面处理高级克制,线条轻薄流畅。随后产品在空中缓慢旋转,画面以极简动态图形同步展示核心参数信息。随后镜头快速收拢,所有零件精准回归组装成完整产品,切换到年轻模特佩戴展示,模特五官立体、气质自信,穿着简洁高级的都市时尚服装,在极简空间和城市光影环境中自然转头、抬手、行走、微笑,镜头从正面、侧面、斜后方展示眼镜佩戴状态,突出轻薄贴合、时尚轮廓与日常百搭属性。结尾在纯色背景中,产品悬浮定格,镜头缓慢推进到品牌logo和核心slogan,整体音乐极简电子氛围配合精准鼓点,节奏干净有力,画面质感高级、克制、纯粹,具有强烈品牌记忆点和国际化科技审美。",
"media": [
{
"type": "file",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260806/ebapmr/glass.pptx"
}
]
},
"parameters": {
"resolution": "480P",
"ratio": "adaptive",
"duration": 10,
"prompt_extend": true
}
}'
Step 2: Get the result by task IDcurl -X GET 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
Video Editing
Pass in a reference video and precisely edit the video through natural language instructions; parts not specified for modification remain unchanged.
- Add elements: Add new objects or characters at specified positions in the video.
- Remove elements: Remove objects or characters from the video, with the background automatically filled in.
- Modify elements: Replace attributes such as a character's appearance, clothing, or age.
- Style/lighting editing: Transform the overall visual style (such as clay or ink wash) or adjust the lighting.
- Dialogue editing: Modify the spoken lines of characters in the video.
- Reference-based editing: Pass in a reference image and add elements from it into the video.
Parameter settings: ratio is recommended to be set to adaptive, and duration to -1 (automatically preserving the original video's aspect ratio and duration). The prompt must include keywords indicating the editing intent (such as "edit video", "remove", "replace", "change to", etc.).
| Capability | Input prompt | Input reference video | Output video |
Modify style | Transform the entire frame into clay style | ||
Dialogue editing | Edit the video, changing the male student's line in the video to: "The deal is done.Now... we disappear." | ||
Reference-based editing | Edit the video: the woman in video 1 puts on the hat from image 1, fitting her head shape naturally. The man in video 1 puts on the hat from image 2, fitting his head shape naturally, and his ochre-brown shirt is replaced with the blue washed loose-fit denim shirt from image 3, collar open and sleeves rolled to the forearms. The two people's movements, clothing, and the rest of the frame remain unchanged. | Reference Video Reference images (3) ![]() ![]() ![]() |
Python SDK
ImportantUpdate the DashScope Python SDK to 2.0.1 or later before running the following code. For update instructions, see Install the SDK.
import os
import dashscope
from dashscope import DashScopeError
# The following is the configuration for the Singapore (ap-southeast-1) region. Replace {WorkspaceId} with your Model Studio workspace ID. The region value varies by region.
client = dashscope.Client(
api_key=os.getenv("DASHSCOPE_API_KEY"),
workspace="{WorkspaceId}",
region="ap-southeast-1",
)
print('please wait...')
# generate is a one-step call (submits the task and waits for completion) that returns a completed Job
try:
job = client.videos.generate(
model='wan3.0-video',
prompt='将整个画面转换为黏土风格',
media=[
{"type": "reference_video", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260402/ldnfdf/wan2.7-videoedit-style-change.mp4"}
],
resolution="720P",
duration=-1,
prompt_extend=True)
print(job)
print("video_url:", job.video_url)
except DashScopeError as e:
print(f"HTTP status code: {e.status_code}")
print(f"Error code: {e.code}")
print(f"Error message: {e.message}")
print("See the documentation: https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
Java SDK
ImportantUpdate the DashScope Java SDK to 2.22.31 or later before running the following code. For update instructions, see Install the SDK.
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class VideoEdit {
static {
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void syncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
List<VideoSynthesisParam.Media> media = new ArrayList<>();
media.add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260402/ldnfdf/wan2.7-videoedit-style-change.mp4")
.type("reference_video")
.build());
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan3.0-video")
.prompt("将整个画面转换为黏土风格")
.media(media)
.resolution("720P")
.duration(-1)
.promptExtend(true)
.build();
VideoSynthesisResult result = null;
try {
System.out.println("---sync call, please wait a moment----");
result = videoSynthesis.call(param);
} catch (ApiException | NoApiKeyException e) {
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
syncCall();
}
}
curl
Step 1: Create a task to get the task IDcurl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "将整个画面转换为黏土风格",
"media": [
{
"type": "reference_video",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260402/ldnfdf/wan2.7-videoedit-style-change.mp4"
}
]
},
"parameters": {
"resolution": "720P",
"duration": -1,
"prompt_extend": true
}
}'
Step 2: Get the result by task IDcurl -X GET 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
Video extension
Extends the duration of an existing video, supporting forward, backward, or bidirectional extension. The visual style and characters remain consistent, and the prompt describes the dynamic changes in the extended portion.
- Backward extension: uses the last frame of the video as the starting point to continue generating subsequent content.
- Forward extension: uses the first frame of the video as the endpoint to generate preceding content.
- Bidirectional extension: uses the video as the middle segment, extending both forward and backward.
Parameter settings: ratio is recommended to be set to adaptive (to preserve the aspect ratio of the original video). The prompt should include keywords indicating the extension intent (such as "extend", "continuation", "extend forward/backward", etc.).
durationis recommended to be set to-1(the model automatically recommends an appropriate duration based on the input), or you can specify the duration of the generated video, that is, the total of the input video duration plus the expected extension duration. For example, if the original video is 5 seconds and you expect to extend backward by 2 seconds,durationcan be set to-1or7.- Note that the total of input duration + output duration must be ≤30 seconds.
| Capability | Input prompt | Input reference video | Output video |
Backward extension | The baker serves the brushed bread, sets the brush aside, and the camera follows the baker to the oven at the rear diagonal for baking. The baker closes the oven door, stands beside the oven, watches the bread baking inside, smells the aroma of the bread, and says: "so good". | ||
Forward extension | Extend video 1 forward by 15s. Character A is a man with short dark brown hair wearing a black tailcoat, white shirt, black bow tie, and beige waistcoat; Character B is a woman with brown hair in an updo wearing a beige vintage puff-sleeve long dress with black lace trim on the skirt and dark teardrop earrings.
| ||
Forward and backward extension | Using the video as the middle segment, continue two seconds forward: the camera follows smoothly, the girl walks slowly toward the camera, stops, gently tilts her head up slightly, takes a deep breath in the cold air, lips slightly parted; using the video as the middle segment, continue three seconds backward: after rubbing her hands, the girl looks directly at the camera and breaks into a warm, radiant smile. She slowly raises a gloved hand to catch a gently falling snowflake, and the camera slowly pulls back into a medium-long shot, revealing a sunny snow-covered forest path, golden-hour backlight, lens flare, shallow depth of field, and a warm, healing atmosphere. |
Prompt: forward extension
Extend video 1 forward by 15s. Character A is a man with short dark brown hair wearing a black tailcoat, white shirt, black bow tie, and beige waistcoat; Character B is a woman with brown hair in an updo wearing a beige vintage puff-sleeve long dress with black lace trim on the skirt and dark teardrop earrings. Inside the ballroom, the light of crystal chandeliers reflects off the marble floor as guests chat in small groups, holding glasses and speaking softly. A melodious waltz string prelude slowly begins, and the crowd's conversations gradually quiet down. Character B walks slowly from one side of the ballroom, her skirt brushing lightly across the marble floor, her gaze surveying the surroundings. Character A steps out from the crowd, walks straight through the guests to Character B, bows slightly and extends his right hand, gazing at her tenderly. Character B lowers her eyes with a faint smile and gently places her right hand in Character A's palm. The two smile at each other, and Character A leads Character B to the center of the dance floor as the surrounding guests naturally step back to make room, all eyes on the two of them. Character A raises Character B's right hand with his left hand and gently supports her waist with his right, and the two take their waltz position, stepping out on the first beat of the strings and beginning to spin. The elegant atmosphere of a 19th-century court ball, in warm golden tones.
Python SDK
ImportantUpdate the DashScope Python SDK to 2.0.1 or later before running the following code. For update instructions, see Install the SDK.
import os
import dashscope
from dashscope import DashScopeError
# The following is the configuration for the Singapore (ap-southeast-1) region. Replace {WorkspaceId} with your Model Studio workspace ID. The region value varies by region.
client = dashscope.Client(
api_key=os.getenv("DASHSCOPE_API_KEY"),
workspace="{WorkspaceId}",
region="ap-southeast-1",
)
print('please wait...')
# generate is a one-step call (submits the task and waits for completion) that returns a completed Job
try:
job = client.videos.generate(
model='wan3.0-video',
prompt='将视频1向后延长,面包师端上刷好的面包,将刷子放到一旁,镜头跟随面包师,去斜后方的烤炉进行烤制',
media=[
{"type": "reference_video", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260414/rptnhd/wan2.7-i2v-video-continuation-2.mp4"}
],
resolution="720P",
ratio="adaptive",
duration=5,
prompt_extend=True)
print(job)
print("video_url:", job.video_url)
except DashScopeError as e:
print(f"HTTP status code: {e.status_code}")
print(f"Error code: {e.code}")
print(f"Error message: {e.message}")
print("See the documentation: https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
Java SDK
ImportantUpdate the DashScope Java SDK to 2.22.31 or later before running the following code. For update instructions, see Install the SDK.
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class VideoExtend {
static {
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void syncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
List<VideoSynthesisParam.Media> media = new ArrayList<>();
media.add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260414/rptnhd/wan2.7-i2v-video-continuation-2.mp4")
.type("reference_video")
.build());
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan3.0-video")
.prompt("将视频1向后延长,面包师端上刷好的面包,将刷子放到一旁,镜头跟随面包师,去斜后方的烤炉进行烤制")
.media(media)
.resolution("720P")
.ratio("adaptive")
.duration(5)
.promptExtend(true)
.build();
VideoSynthesisResult result = null;
try {
System.out.println("---sync call, please wait a moment----");
result = videoSynthesis.call(param);
} catch (ApiException | NoApiKeyException e) {
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
syncCall();
}
}
curl
Step 1: Create a task to get the task IDcurl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "将视频1向后延长,面包师端上刷好的面包,将刷子放到一旁,镜头跟随面包师,去斜后方的烤炉进行烤制",
"media": [
{
"type": "reference_video",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260414/rptnhd/wan2.7-i2v-video-continuation-2.mp4"
}
]
},
"parameters": {
"resolution": "720P",
"ratio": "adaptive",
"duration": 5,
"prompt_extend": true
}
}'
Step 2: Get the result by task IDcurl -X GET 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
Input media
Each element in the input.media array contains two fields: type and url. The supported types and restrictions are as follows:
type | Description | Restrictions |
| First frame image, strictly used as the first frame of the video | Up to 1 image |
| Last frame image, strictly used as the last frame of the video | Up to 1 image |
| Reference image | Up to 10 images |
| Reference Video | Up to 5 clips, with a total duration of no more than 15 seconds |
| Reference Audio | Up to 5 clips, with a total duration of no more than 15 seconds |
| File (docx, doc, xlsx, xls, pptx, ppt, pdf, txt, md) | Up to 1, cannot be input together with link |
| Web page link (public web page) | Up to 1, cannot be input together with file |
ImportantThe reference_xx/file/link types and the first_frame/last_frame types are mutually exclusive and cannot be mixed in the same request.
Output video
- Resolution: 480P, 720P, 1080P (default).
- Aspect ratio: 16:9, 4:3, 1:1, 3:4, 9:16, adaptive (default, adapts to the input media).
- Duration: 2~30 seconds; -1 (smart duration, 5 seconds by default). When video input is provided, the total input + output duration must be ≤30 seconds.
- Format: MP4, 30fps frame rate.
- Video with audio: enabled by default, can be disabled via
audio=false. - The video URL is valid for 24 hours; save it promptly.
Billing and rate limits
- For billing details, see Model pricing.
- For rate limit details, see Rate limits.







