Skip to main content
Wan 2.6 and earlier

Wan 2.6 and earlier — generate a video from text

Submit text-to-video task (wan2.6 and earlier)

POST
https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/video-generation/video-synthesis
import os
import dashscope

# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
client = dashscope.Client(
  api_key=os.getenv("DASHSCOPE_API_KEY"),
  base_url="https://ap-southeast-1.maas.qwencloudapi.com/api/v1",
)

print('please wait...')
job = client.videos.generate(
  model='wan2.6-t2v',
  prompt='A thrilling detective chase story with cinematic storytelling. Shot 1 [0\u20133 s]: Wide shot of a rainy New York street at night, neon lights flickering, a detective in a black trench coat walking briskly. Shot 2 [3\u20136 s]: Medium shot of the detective entering an old building, rain soaking his coat, the door closing slowly behind him. Shot 3 [6\u20139 s]: Close-up of the detective\'s focused, determined eyes as distant sirens wail and he frowns slightly in thought. Shot 4 [9\u201312 s]: Medium shot of the detective moving carefully down a dim hallway, his flashlight illuminating the path ahead. Shot 5 [12\u201315 s]: Close-up of the detective discovering a key clue, his face lighting up with sudden realization.',
  size="1280*720",
  duration=15,
  parameters={'shot_type': "multi"},
  prompt_extend=True,
  watermark=False)
print(job)
print("video_url:", job.video_url)
{
  "request_id": "c1209113-8437-424f-a386-xxxxxx",
  "output": {
    "task_id": "966cebcd-dedc-4962-af88-xxxxxx",
    "task_status": "PENDING"
  }
}
The Wan text-to-video model accepts text, images, and audio as input and generates videos up to 15 seconds long at 1080P resolution.
  • Core capabilities: Integer video durations (2–15 seconds), custom resolutions (480P, 720P, 1080P), prompt rewriting, and watermarking.
  • Audio capabilities: Automatic dubbing or custom audio files for audio-video sync. (Supported by wan2.5 and wan2.6)
  • Multi-shot narrative: Multiple shots with consistent main subject across transitions. (Supported only by wan2.6)

Authorizations

string
header
required

DashScope API Key. Get one from the QwenCloud console.

Header Parameters

enum<string>
required

Must be set to enable for asynchronous task submission.

enable

Body

application/json
enum<string>
required

Model name. See the model table in the endpoint description for supported models and their capabilities. For Wan 2.1 in China North 2 (Beijing) (cn-beijing), use the wanx2.1-* form: wanx2.1-t2v-plus and wanx2.1-t2v-turbo.

wan2.6-t2v,wan2.5-t2v-preview,wan2.2-t2v-plus,wan2.1-t2v-turbo,wan2.1-t2v-plus,wanx2.1-t2v-plus,wanx2.1-t2v-turbo
wan2.6-t2v
object
required

Input data for video generation.

object

Video generation parameters.

Response

200-application/json
string

Unique request identifier for tracing and troubleshooting.

c1209113-8437-424f-a386-xxxxxx
object