The PixVerse - Video Upscale model enhances input video resolution using super-resolution processing, producing a fixed 4K (3840×2160) output video.
ImportantThis document applies only to the China (Beijing) region. You must 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.
Applicable scope
To ensure a successful API call, make sure that the model, Endpoint URL, and API Key all belong to the same region. Cross-region calls will fail.
NoteThe video upscale examples in this topic apply to the China (Beijing) region.
HTTP call
Since video upscale tasks take a relatively long time (typically 1-5 minutes), the API uses asynchronous calls. The entire process consists of two core steps: "Create task -> Poll for result", as follows:
Step 1: Create a task to obtain the task ID
Beijing region: POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
When calling, replace {WorkspaceId} with your actual workspace ID.
Note
- After the task is created, use the
task_id returned by the API to query the result. The task_id is valid for 24 hours. Do not create duplicate tasks. Just poll to retrieve the result.
Request parameters Request headers Content-Typestring(Required) The request content type. This parameter must be set to application/json. Authorizationstring(Required) Request authentication. The API uses an Alibaba Cloud Model Studio API key for authentication. Example: Bearer sk-xxxx. X-DashScope-Asyncstring(Required) The asynchronous processing configuration parameter. HTTP requests support asynchronous calls only and this parameter must be set to enable. ImportantIf this request header is missing, the error "current user api does not support synchronous calls" is returned. Request body model string (Required) The model name. Fixed value: pixverse/pixverse-upscale. input object (Required) The basic input information, including the video to be upscaled. Properties media array (Required) The media resource list. Must contain 1 video element. Element properties type string (Required) The media asset type. Fixed value: url string (Required) The URL of the input video. Must be a publicly accessible URL. Video limits:
- Formats: MP4, MOV, WebM.
- Resolution: 4K and above are not supported.
- File size: Up to 100MB.
- Duration: Up to 30 seconds.
parameters object (Optional) Video generation parameters, such as whether to add a watermark and the random seed. Properties watermark boolean (Optional) Whether to add a watermark. The watermark is located at the bottom-right corner of the video with the fixed text "AI-generated".
false: Default. No watermark is added.
true: Add a watermark.
seedinteger(Optional) The random number seed, in the range [0, 2147483647]. If not specified, the system automatically generates a random seed. To improve the reproducibility of the results, use a fixed seed value. Note that because model generation is probabilistic, even the same seed does not guarantee identical results each time. | Video UpscaleSubmit a video file to output a super-resolution video. # 调用时请将 {WorkspaceId} 替换为真实的业务空间ID。
curl --location 'https://{WorkspaceId}.cn-beijing.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": "pixverse/pixverse-upscale",
"input": {
"media": [
{
"type": "video_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250919/wqefue/mix_input_video.mp4"
}
]
},
"parameters": {
"seed": 12345,
"watermark": true
}
}'
Python SDKimport dashscope
import os
from dashscope import DashScopeError
# 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
# 获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
client = dashscope.Client(api_key=os.getenv("DASHSCOPE_API_KEY"))
media = [{'type': 'video_url', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250919/wqefue/mix_input_video.mp4'}]
def sample_async_call():
# 异步提交视频生成任务
try:
job = client.videos.jobs.create(model='pixverse/pixverse-upscale',
media=media,
seed=12345,
watermark=True)
print(job)
print("task_id: %s" % job.task_id)
except DashScopeError as e:
print(f"HTTP返回码:{e.status_code}")
print(f"错误码:{e.code}")
print(f"错误信息:{e.message}")
print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")
return
# 查询任务状态
try:
snapshot = client.videos.jobs.fetch(job.task_id)
print(snapshot.status)
except DashScopeError as e:
print(f"HTTP返回码:{e.status_code}")
print(f"错误码:{e.code}")
print(f"错误信息:{e.message}")
print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")
# 等待任务完成
try:
done = client.videos.jobs.wait(job)
print(done)
print(done.video_url)
except DashScopeError as e:
print(f"HTTP返回码:{e.status_code}")
print(f"错误码:{e.code}")
print(f"错误信息:{e.message}")
print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")
if __name__ == '__main__':
sample_async_call()
|
Step 2: Query the result by task ID
Beijing region: GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
Note
- Polling recommendation: Video generation typically takes several minutes. Use a polling mechanism with a reasonable query interval (e.g., 15 seconds) to retrieve results.
- Task status flow: PENDING (queued) → RUNNING (processing) → SUCCEEDED (success) / FAILED (failure).
- task_id validity: 24 hours. After expiration, results can no longer be queried, and the API will return the task status as
UNKNOWN.
- RPS limit: The query API has a default RPS of 20. For higher-frequency queries or event notifications, consider configuring asynchronous task callbacks.
- More operations: For batch queries, task cancellation, and other operations, see Manage asynchronous tasks.
Request parameters Request headers Authorizationstring(Required) Request authentication. The API uses an Alibaba Cloud Model Studio API key for authentication. Example: Bearer sk-xxxx. URL path parameters task_id string(Required) The task ID. | Query task resultReplace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours. Also, replace {WorkspaceId} with your actual workspace ID. curl -X GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
|
Response parameters outputobject The task output information. Properties task_id string The task ID. Valid for queries for 24 hours. task_status string The task status. Enumeration values
- PENDING: Task queued
- RUNNING: Task processing
- SUCCEEDED: Task executed successfully
- FAILED: Task execution failed
- CANCELED: Task canceled
- UNKNOWN: Task does not exist or status unknown
State transitions during polling:
- PENDING (queued) → RUNNING (processing) → SUCCEEDED (success) / FAILED (failure).
- The initial query status is usually PENDING (queued) or RUNNING (processing).
- When the status changes to SUCCEEDED, the response contains the generated video URL.
- If the status is FAILED, check the error message and retry.
- If the status is CANCELED, the task has been canceled. To continue, submit the task again.
- If the status is UNKNOWN, the task does not exist or its status is unknown, which may occur when the task_id does not exist or the 24-hour validity period has expired.
submit_time string The task submission time. The format is YYYY-MM-DD HH:mm:ss.SSS. scheduled_time string The task execution time. The format is YYYY-MM-DD HH:mm:ss.SSS. end_time string The task completion time. The format is YYYY-MM-DD HH:mm:ss.SSS. video_urlstring The video URL. Returned only when task_status is SUCCEEDED. The video format is MP4 (H.264 encoding). The video link currently has no expiration time, but it is not recommended for long-term storage. Download it promptly. orig_prompt string The original input prompt, corresponding to the request parameter prompt. codestring The error code returned when the request fails. This parameter is not returned on success. For details, see Error codes. messagestring The detailed information about the failed request. This parameter is not returned on success. For details, see Error codes. usage object Output statistics. Only successful results are counted. Properties duration integer The billing duration (in seconds). Rounded up from the uploaded video duration. size string The resolution of the output video. fps integer The frame rate of the output video. SR string The resolution tier of the output video. video_count integer The number of videos. Fixed value: 1. | Task succeeded{
"request_id": "19171ea5-9efb-4d35-93a1-xxxxxx",
"output": {
"task_id": "7ed706b7-a9a9-4319-820c-xxxxxx",
"task_status": "SUCCEEDED",
"submit_time": "2026-07-14 10:34:41.630",
"scheduled_time": "2026-07-14 10:34:41.655",
"end_time": "2026-07-14 10:35:12.725",
"video_url": "https://media.pixverseai.cn/xxxx.mp4"
},
"usage": {
"duration": 6,
"size": "3840*2156",
"fps": 24,
"video_count": 1,
"SR": "4K"
}
}
Task failedIf the task fails, task_status is set to FAILED, with the error code and message provided. See Error codes for troubleshooting. {
"request_id": "e5d70b02-ebd3-98ce-9fe8-759d7d7b107d",
"output": {
"task_id": "86ecf553-d340-4e21-af6e-a0c6a421c010",
"task_status": "FAILED",
"code": "InvalidParameter",
"message": "Invalid field type or value. Please verify your input data."
}
}
Task query expiredThe task_id is valid for queries for 24 hours. After this period, queries are no longer possible and the following error is returned. {
"request_id": "a4de7c32-7057-9f82-8581-xxxxxx",
"output": {
"task_id": "502a00b1-19d9-4839-a82f-xxxxxx",
"task_status": "UNKNOWN"
}
}
|
Error codes
If the model call fails and returns an error message, see Error codes for troubleshooting.