The PixVerse text-to-video model generates a smooth video based on text prompts.
This document applies only to the China (Beijing) region. Use an API key from this region.
Activate the service
Go to the Alibaba Cloud Model Studio console, search for PixVerse, find the PixVerse model card, and click Activate Now.
In the pop-up window, confirm the activation and authorization.
Scope
To ensure successful calls, make sure that the model, Endpoint URL, and API key all belong to the same region. Cross-region calls will fail.
Select a model: Confirm the region where the model belongs.
Select a URL: Choose the corresponding regional Endpoint URL. HTTP URLs and DashScope SDK URLs are supported.
Configure an API key: Select a region and obtain an API key. Then, configure the API key as an environment variable (This method is being deprecated and will be merged into the standard API key configuration).
Install the SDK: To make calls using an SDK, install the DashScope SDK.
HTTP calls
Because text-to-video tasks take a long time (typically 1 to 5 minutes), the API uses asynchronous calls. The entire process involves two core steps: Create a task -> Poll for the result. The steps are as follows:
Step 1: Create a task to get a task ID
Beijing region: POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
After the task is created, use the returned
task_idto query the result. Thetask_idis valid for 24 hours. Do not create duplicate tasks. Instead, use polling to retrieve the result.For guidance for beginners, see Postman.
Request parameters | Text-to-videoSupported models: pixverse/pixverse-c1-t2v, pixverse/pixverse-v6-t2v, pixverse/pixverse-v5.6-t2v. Text-to-video (multi-shot)pixverse-c1Supported model: pixverse/pixverse-c1-t2v. Describe the multi-shot scene in the pixverse-v6Supported model: pixverse/pixverse-v6-t2v. Describe the multi-shot scene in the |
Headers | |
Content-Type The content type of the request. Must be | |
Authorization Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
X-DashScope-Async Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be Important If this request header is missing, the error "current user api does not support synchronous calls" is returned. | |
Request Body | |
model The model name. For model output specifications, see Model List. Valid values:
| |
input The basic input information, such as the prompt. | |
parameters The video generation parameters, such as the video resolution, duration, and whether to generate audio. |
Response parameters | Successful responseSave the Error responseTask creation failed. See Error messages. |
output The output of the task. | |
request_id Unique request identifier for tracing and troubleshooting. | |
code Error code. Returned only for failed requests. See Error messages. | |
message Detailed error message. Returned only for failed requests. See Error messages. |
Step 2: Query the result by task ID
Beijing region: GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
Polling suggestion: Video generation takes several minutes. We recommend using a polling mechanism with a reasonable query interval (for example, 15 seconds) to obtain the result.
Task status flow: PENDING (in queue) -> RUNNING (processing) -> SUCCEEDED (successful) / FAILED (failed).
task_id validity: 24 hours. After this period, you cannot query the result, and the API will return the task status as
UNKNOWN.RPS limit: The default records per second (RPS) for the query API is 20. For higher frequency queries or event notifications, we recommend configuring an asynchronous task callback.
More operations: For batch queries, canceling tasks, and other operations, see Manage asynchronous tasks.
Request parameters | Query task resultReplace |
Headers | |
Authorization Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
Path parameters | |
task_id The ID of the task. |
Response parameters | Task successfulTask failedWhen a task fails, Task query expiredThe |
output The task output information. | |
usage Statistics for the output information. Only successful results are counted. | |
request_id Unique request identifier for tracing and troubleshooting. |
DashScope SDK calls
The parameter names in the SDK are mostly consistent with the HTTP API. The parameter structure is adapted to the features of each programming language.
Because text-to-video tasks take a long time (typically 1 to 5 minutes), the SDK encapsulates the HTTP asynchronous call process and supports both synchronous and asynchronous call methods.
The specific time required depends on the number of tasks in the queue and the service execution status. Please be patient while waiting for the result.
Python SDK calls
Make sure that your DashScope Python SDK version is 1.25.8 or later before running the following code.
An earlier version might trigger errors such as "url error, please check url!". To update the SDK, see Install the SDK.
Beijing region: dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
Synchronous call
Request example
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# The API endpoint for the Beijing region.
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
# If you have not configured the environment variable, replace the following line with your Model Studio API key. For example: api_key="sk-xxx"
# For more information about how to obtain an API key, see https://help.aliyun.com/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
def sample_sync_call_t2v():
# Call the synchronous API, which returns the result directly.
print('please wait...')
rsp = VideoSynthesis.call(api_key=api_key,
model='pixverse/pixverse-c1-t2v',
prompt='In a rainy cyber city, a raccoon walks on a railing. Suddenly, its eyes glow blue, and it transforms into a high-tech drone, flying quickly out of the frame.',
size='1280*720',
duration=5,
audio=False,
watermark=False)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_sync_call_t2v()Response example
video_url does not expire, but it is not intended for long-term storage. We recommend that you download the video promptly.{
"status_code": 200,
"request_id": "2b68d32e-86c8-4383-8a18-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "ec40bb42-02d4-44d8-bf35-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://media.pixverseai.cn/xxx.mp4",
"submit_time": "2026-03-20 10:59:01.993",
"scheduled_time": "2026-03-20 10:59:02.028",
"end_time": "2026-03-20 11:00:06.322",
"orig_prompt": "In a rainy cyber city, a raccoon walks along a railing. Suddenly, its eyes glow blue, and it transforms into a high-tech drone, flying quickly out of frame."
},
"usage": {
"video_count": 1,
"video_duration": 0,
"video_ratio": "",
"duration": 10,
"size": "1280x720",
"fps": 24,
"audio": false,
"SR": "720"
}
}Asynchronous call
Request example
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# The URL for the Beijing region.
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
# If you have not configured the environment variable, replace the following line with your Model Studio API key, such as api_key="sk-xxx".
# To obtain an API key, see https://help.aliyun.com/en/model-studio/get-api-key.
api_key = os.getenv("DASHSCOPE_API_KEY")
def sample_async_call_t2v():
# Call the async API. This returns the task information.
# You can retrieve the task status using the returned task ID.
rsp = VideoSynthesis.async_call(api_key=api_key,
model='pixverse/pixverse-c1-t2v',
prompt='In a rainy cyber city, a raccoon walks on a railing. Suddenly, its eyes glow blue, and it transforms into a high-tech drone, flying quickly out of the frame.',
size='1280*720',
duration=5,
audio=False,
watermark=True)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print("task_id: %s" % rsp.output.task_id)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
# Retrieve the task information, including the task status.
status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
if status.status_code == HTTPStatus.OK:
print(status.output.task_status) # Check the task status.
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(status.status_code, status.code, status.message))
# Wait for the task to complete. This method calls fetch at intervals and checks whether the task is in a finished state.
rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_async_call_t2v()Response example
1. Response example for creating a task
{
"status_code": 200,
"request_id": "c86ff7ba-8377-917a-90ed-xxxxxx",
"code": "",
"message": "",
"output": {
"task_id": "721164c6-8619-4a35-a6d9-xxxxxx",
"task_status": "PENDING",
"video_url": ""
},
"usage": null
}2. Response example for querying a task result
video_url does not expire but is not intended for long-term storage. You should download the video promptly.{
"status_code": 200,
"request_id": "2b68d32e-86c8-4383-8a18-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "ec40bb42-02d4-44d8-bf35-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://media.pixverseai.cn/xxx.mp4",
"submit_time": "2026-03-20 10:59:01.993",
"scheduled_time": "2026-03-20 10:59:02.028",
"end_time": "2026-03-20 11:00:06.322",
"orig_prompt": "In a rainy cyber city, a raccoon walks along a railing. Suddenly, its eyes glow blue, and it transforms into a high-tech drone, flying quickly out of frame."
},
"usage": {
"video_count": 1,
"video_duration": 0,
"video_ratio": "",
"duration": 10,
"size": "1280x720",
"fps": 24,
"audio": false,
"SR": "720"
}
}Java SDK calls
Make sure that your DashScope Java SDK version is 2.22.6 or later before running the following code.
An earlier version might trigger errors such as "url error, please check url!". To update the SDK, see Install the SDK.
Beijing region: Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
Synchronous call
Request example
// 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.JsonUtils;
import com.alibaba.dashscope.utils.Constants;
public class Text2Video {
static {
// The following is the URL for the Beijing region.
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
}
// If you have not configured the environment variable, replace the following line with your Model Studio API key, for example: api_key="sk-xxx"
// To obtain an API key, see: https://help.aliyun.com/en/model-studio/get-api-key
public static String apiKey = System.getenv("DASHSCOPE_API_KEY");
/**
* Creates a video synthesis task and waits for the task to complete.
*/
public static void text2Video() throws ApiException, NoApiKeyException, InputRequiredException {
VideoSynthesis vs = new VideoSynthesis();
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("pixverse/pixverse-c1-t2v")
.prompt("In a rainy cyber city, a raccoon walks on a railing. Suddenly, its eyes glow blue, and it transforms into a high-tech drone, flying quickly out of the frame.")
.size("1280*720")
.duration(5)
.audio(true)
.watermark(true)
.seed(12345)
.build();
System.out.println("Please wait...");
VideoSynthesisResult result = vs.call(param);
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
try {
text2Video();
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}
}Response example
video_url does not expire. It is not intended for long-term storage, so you should download it promptly.{
"request_id": "bd1109bd-6c63-4e62-8bb8-xxxxxx",
"output": {
"task_id": "72af7c13-dad5-4aaa-b85d-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://media.pixverseai.cn/xxx.mp4",
"orig_prompt": "In a rainy cyber city, a raccoon walks on a railing. Suddenly, its eyes glow blue, and it transforms into a high-tech drone, flying quickly out of the frame.",
"submit_time": "2026-03-20 11:21:13.227",
"scheduled_time": "2026-03-20 11:21:13.252",
"end_time": "2026-03-20 11:21:43.924"
},
"usage": {
"video_count": 1,
"duration": 5.0,
"size": "1280*720",
"input_video_duration": 0.0,
"output_video_duration": 0.0,
"SR": "720"
},
"status_code": 200,
"code": "",
"message": ""
}Asynchronous call
Request example
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisListResult;
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.task.AsyncTaskListParam;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;
public class Text2Video {
static {
// The following URL is for the Beijing region.
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
}
// If you have not configured the environment variable, replace the following line with your Model Studio API key. For example: public static String apiKey = "sk-xxx";
// To obtain an API key, see https://help.aliyun.com/en/model-studio/get-api-key
public static String apiKey = System.getenv("DASHSCOPE_API_KEY");
/**
* Creates a video synthesis task and waits for the task to complete.
*/
public static void text2Video() throws ApiException, NoApiKeyException, InputRequiredException {
VideoSynthesis vs = new VideoSynthesis();
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("pixverse/pixverse-c1-t2v")
.prompt("In a rainy cyber city, a raccoon walks on a railing. Suddenly, its eyes glow blue, and it transforms into a high-tech drone, flying quickly out of the frame.")
.size("1280*720")
.duration(5)
.audio(true)
.watermark(true)
.seed(12345)
.build();
// Asynchronous call
VideoSynthesisResult task = vs.asyncCall(param);
System.out.println(JsonUtils.toJson(task));
System.out.println("please wait...");
// Retrieve the result.
VideoSynthesisResult result = vs.wait(task, apiKey);
System.out.println(JsonUtils.toJson(result));
}
// Retrieve the task list.
public static void listTask() throws ApiException, NoApiKeyException {
VideoSynthesis is = new VideoSynthesis();
AsyncTaskListParam param = AsyncTaskListParam.builder().build();
param.setApiKey(apiKey);
VideoSynthesisListResult result = is.list(param);
System.out.println(result);
}
// Retrieve a single task result.
public static void fetchTask(String taskId) throws ApiException, NoApiKeyException {
VideoSynthesis is = new VideoSynthesis();
// If the DASHSCOPE_API_KEY environment variable is set, the apiKey parameter can be null.
VideoSynthesisResult result = is.fetch(taskId, apiKey);
System.out.println(result.getOutput());
System.out.println(result.getUsage());
}
public static void main(String[] args) {
try {
text2Video();
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}
}Response example
1. Response example for creating a task.
{
"request_id": "9b583f1b-2423-4fac-bb3f-xxxxxx",
"output": {
"task_id": "3944b819-1bbb-4da0-a230-xxxxxx",
"task_status": "PENDING"
},
"status_code": 200,
"code": "",
"message": ""
}2. Response example for querying a task result
video_url does not expire, but it is not intended for long-term storage. You should download the video promptly.{
"request_id": "bd1109bd-6c63-4e62-8bb8-xxxxxx",
"output": {
"task_id": "72af7c13-dad5-4aaa-b85d-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://media.pixverseai.cn/xxx.mp4",
"orig_prompt": "In a rainy cyber city, a raccoon walks on a railing. Suddenly, its eyes glow blue, and it transforms into a high-tech drone, flying quickly out of the frame.",
"submit_time": "2026-03-20 11:21:13.227",
"scheduled_time": "2026-03-20 11:21:13.252",
"end_time": "2026-03-20 11:21:43.924"
},
"usage": {
"video_count": 1,
"duration": 5.0,
"size": "1280*720",
"input_video_duration": 0.0,
"output_video_duration": 0.0,
"SR": "720"
},
"status_code": 200,
"code": "",
"message": ""
}Error codes
If the model call fails and returns an error message, see Error messages for resolution.
FAQ
Q: Why can't I use a 10-second duration with 1080P resolution?
A: The pixverse-v5.6-t2v model does not support a 10-second duration at 1080P. We recommend reducing the resolution to 720P, 540P, or 360P, or switching to the pixverse-c1-t2v or pixverse-v6-t2v model.