The PixVerse image-to-video model generates a smooth video from an input image and a text prompt .
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 invocations, the model, endpoint URL, and API key must all belong to the same region. Cross-region invocations will fail.
- Select a model: Confirm the region where the model resides.
- Select a URL: Choose the corresponding regional endpoint URL. HTTP URLs and DashScope SDK URLs are supported.
- Configure an API key: Obtain an API key for the region, and then configure the API key as an environment variable.
The sample code in this topic applies to the China (Beijing) region.
HTTP invocation
Image-to-video tasks take a long time to run—typically 1 to 5 minutes—and use asynchronous invocation. The process consists of two core steps: Create a task → Poll for the result. Follow these steps:
Step 1: Create a task to get a task ID
Beijing region: POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Replace {WorkspaceId} with your actual workspace ID.
- 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 Call APIs with Postman or cURL.
Request parametersContent-Typestring (Required)The content type of the request. Must be application/json.Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.X-DashScope-Async string (Required)Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be enable.Request bodymodelstring (Required)The model name.Valid values:
Model selection
object (Required)Basic input information, including prompts and media materials.
Properties prompt string (Optional)The text prompt describes the elements and visual features you want in the generated video.Chinese and English are supported. Each Chinese character or letter counts as one character. Character encoding is UTF-8. Text exceeding the limit is automatically truncated.
array (Required)A list of media materials specifying the images required for video generation.Each array element is a media object containing the type and url fields.
Properties type string (Required)The type of media material. Valid value:
If you provide multiple images, the system uses the last one. To ensure expected results, always provide only one image.url string (Required)The URL of the image file. The URL must be publicly accessible over the internet.
object (Optional)Video processing parameters, such as resolution, duration, audio generation, and watermarking.
Properties resolution string (Required)Specifies the resolution level of the generated video.Valid values: 360P, 540P, 720P, and 1080P.duration integer (Required)The duration of the generated video, in seconds.
boolean (Optional)Specifies whether to generate a video with audio. If enabled, the model automatically generates matching background music or sound effects based on the video content.
boolean (Optional)Specifies whether to add a watermark. The watermark appears in the lower-right corner of the video and displays the fixed text "Generated by AI".
string (Optional)Supported model: pixverse/pixverse-v6-it2v.Specifies the shot type of the generated video—single continuous shot or multiple shots.
integer (Optional)The random number seed must be an integer in the range [0, 2147483647].If not specified, a random seed is generated. A fixed seed improves reproducibility.Because model generation is probabilistic, the same seed does not guarantee identical results. |
Supported models: pixverse/pixverse-c1-it2v, pixverse/pixverse-v6-it2v, and pixverse/pixverse-v5.6-it2v. |
Response parametersoutputobjectTask output information.
Properties task_id stringThe task ID. Valid for queries for 24 hours.task_status stringThe status of the task.
Enumeration values
stringUnique request identifier for tracing and troubleshooting.code stringError code. Returned only for failed requests. See Error codes.message stringDetailed error message. Returned only for failed requests. See Error codes. |
Save the task_id to query the task status and result. |
Step 2: Query the result by task ID
Beijing region: GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
- Polling suggestion: Video generation takes several minutes. Use a polling mechanism with a reasonable interval—such as 15 seconds—to retrieve the result.
- Task status flow: PENDING (queued) → RUNNING (processing) → SUCCEEDED (completed) / FAILED (failed).
- task_id validity period: 24 hours. After this period, you can no longer query the result, and the API returns the task status as
UNKNOWN. - RPS limit: The default records per second (RPS) for the query API is 20. For higher-frequency polling or event notifications, configure an asynchronous task callback.
- More operations: For batch queries and task cancellation, see Manage asynchronous tasks.
Request parametersHeadersAuthorizationstring (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.Path parameterstask_idstring (Required)The ID of the task. |
Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours, Replace {WorkspaceId} with your actual workspace ID. |
Response parametersoutputobjectTask output information.
Properties task_id stringThe task ID. Valid for queries for 24 hours.task_status stringThe status of the task.
Enumeration values
stringThe time when the task was submitted. format is YYYY-MM-DD HH:mm:ss.SSS.scheduled_time stringThe time when the task was executed. format is YYYY-MM-DD HH:mm:ss.SSS.end_time stringThe time when the task was completed. format is YYYY-MM-DD HH:mm:ss.SSS.video_urlstringThe video URL. Returned only when task_status is SUCCEEDED.The video format is MP4 (H.264 encoding). The video link does not currently expire, but avoid relying on it for long-term storage. Download the video promptly.orig_prompt stringThe original input prompt, corresponding to the request parameter prompt.code stringError code. Returned only for failed requests. See Error codes.message stringDetailed error message. Returned only for failed requests. See Error codes.objectStatistics for the output information. Only successful results are counted.
Properties duration integerThe total duration of the generated video, used for billing.size stringThe resolution of the generated video.fps integerThe frame rate of the generated video.SR stringThe resolution level of the generated video.audio booleanIndicates whether the generated video contains audio.video_count integerThe number of generated videos. Value is fixed at 1.shot_typestringThe shot type of the generated video.stringUnique request identifier for tracing and troubleshooting. |
|