Text-to-video: create a video generation task from a text prompt
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "wan2.7-t2v",
"input": {
"prompt": "A lighthouse on the seashore at dusk, the camera slowly pushing in, waves gently lapping the rocks, seabirds calling, cinematic lighting, steady camera work"
}
}
'{
"output": {
"task_id": "c2e7570c-0af2-4eba-919f-3af3d1164a38",
"task_status": "PENDING"
},
"request_id": "a23b81b0-0c05-9972-a6c9-ee757400afdb"
}Wan2.7 Video Generation (Alibaba)
Wan2.7 Text-to-Video API Reference
Wan2.7-t2v text-to-video API reference and live playground: generate 2-15 second video from a pure text prompt via the DashScope async passthrough endpoint.
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Text-to-video: create a video generation task from a text prompt
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "wan2.7-t2v",
"input": {
"prompt": "A lighthouse on the seashore at dusk, the camera slowly pushing in, waves gently lapping the rocks, seabirds calling, cinematic lighting, steady camera work"
}
}
'{
"output": {
"task_id": "c2e7570c-0af2-4eba-919f-3af3d1164a38",
"task_status": "PENDING"
},
"request_id": "a23b81b0-0c05-9972-a6c9-ee757400afdb"
}Documentation Index
Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
Use this file to discover all available pages before exploring further.
The Playground on the right lets you debug directly: put
Bearer sk-your-api-key in Authorization, fill in model / input / parameters, and send the request. A successful submission returns a task_id; see below for polling and download.This page is the creation endpoint for
wan2.7-t2v (text-to-video). It needs only a text prompt, no media. To make an image move or preserve subject features, use Image-to-Video / Reference-to-Video instead. For the full async flow, status table, and Python client, see the Wan Overview.- Creation requests must go to
/wan/api/v1/services/aigc/video-generation/video-synthesiswith the headerX-DashScope-Async: enable. Do not use/v1/videos. durationmust be an integer (5, not"5"); writeresolutionin uppercase (720P).
Code examples
curl -X POST "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis" \
-H "X-DashScope-Async: enable" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-t2v",
"input": {
"prompt": "A lighthouse on the seashore at dusk, the camera slowly pushing in, waves gently lapping the rocks, seabirds calling, cinematic lighting, steady camera work"
},
"parameters": {
"resolution": "720P",
"duration": 5,
"prompt_extend": true,
"watermark": true
}
}'
Parameter quick reference
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | ✓ | — | Fixed wan2.7-t2v |
input.prompt | string | ✓ | — | Text prompt; describe scene, camera motion, lighting, and style |
input.negative_prompt | string | — | Negative prompt, ≤500 characters | |
parameters.resolution | string | 720P | 720P / 1080P (uppercase) | |
parameters.ratio | string | 16:9 | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 | |
parameters.duration | int | 5 | 2-15 second integer | |
parameters.prompt_extend | bool | true | Smart rewriting, recommended on | |
parameters.watermark | bool | false | ”AI generated” watermark in the bottom-right corner | |
parameters.seed | int | random | 0-2147483647, fix for reproducibility |
Response format
A successful creation returns atask_id (not the video itself):
{
"output": { "task_id": "c2e7570c-0af2-4eba-919f-3af3d1164a38", "task_status": "PENDING" },
"request_id": "a23b81b0-0c05-9972-a6c9-ee757400afdb"
}
After submitting, poll
GET /v1/tasks/{task_id} until status: "completed", then download the mp4 from the response’s result_url. Do not send the Authorization header when downloading (OSS signed direct link); result_url expires in 24 hours by default. For the full polling loop and Python client, see Wan Overview · Async call flow.Authorizations
The API Key obtained from the APIYI console
Headers
Async processing switch; must be set to enable, otherwise it returns current user api does not support synchronous calls
Available options:
enable Body
application/json
Was this page helpful?
⌘I