Skip to main content

Video style transform API Reference

Transform input videos into artistic styles while preserving smooth motion and content coherence. Supports eight styles: Japanese manga, American comic, fresh comic, 3D cartoon, Chinese cartoon, paper art, simple illustration, and Chinese ink wash painting.

This document applies only to the China (Beijing) region, and you must use an API key from this region.

Effect showcase

Input videoOutput video (Japanese manga)
For more examples, see Appendix: More style effect demonstrations.

Prerequisites

Before calling the API, you need to get an API key, and then set the API key as the environment variable DASHSCOPE_API_KEY.

HTTP invocation

Video processing is time-consuming. To avoid synchronous request timeouts, video style transform uses asynchronous invocation, which consists of the following two steps:
  1. Submit an asynchronous task: Send a POST request with the original video URL and the desired style parameters to obtain a unique task_id.
  2. Query the task result: Use the task_id to poll the task status with GET requests until the task is completed and the URL of the result video is obtained.

Step 1: Submit a video style transform task

POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

Request

Request headers
Content-Typestring (required)The content type of the request. This parameter must be set to application/json.Authorizationstring (required)The authentication of the request. The API uses an Alibaba Cloud Model Studio API key for authentication. Example value: Bearer sk-xxxx.X-DashScope-Asyncstring (required)The asynchronous processing configuration parameter. HTTP requests only support asynchronous processing, and it must be set to enable.
If this header is missing, the following error is returned: "current user api does not support synchronous calls".
Request body
modelstring (required)The model name. Set it to video-style-transform.inputobject (required)The input content.

Attributes

video_urlstring (required)The public URL of the input video. Example: https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250704/viwndw/%E5%8E%9F%E8%A7%86%E9%A2%91.mp4.Input video requirements:
  • Resolution: Each side of the video must be no less than 256 pixels and no more than 4,096 pixels. The ratio of the long side to the short side cannot exceed 1.8.
  • Format: MP4, AVI, MKV, MOV, FLV, TS, MPG, and MXF are supported.
  • Duration: No more than 30 seconds.
  • Size: No more than 100 MB.
  • URL: If the original URL contains non-ASCII characters such as Chinese characters, URL-encode it first.
parametersobject (optional)The video processing parameters.

Attributes

styleint (optional)The style type. Preset types are as follows:
  • 0: Japanese manga, the default value
  • 1: American comic
  • 2: Fresh comic
  • 3: 3D cartoon
  • 4: Chinese cartoon (best for inputs with ancient costumes)
  • 5: Paper art style
  • 6: Simple illustration
  • 7: Chinese ink wash painting
video_fpsint (optional)The frame rate of the generated video. The default is 15, and the valid range is [15, 25].animate_emotionbool (optional)Whether to optimize facial expressions. The default is true.When enabled, it usually improves the accuracy of lip sync and expression synchronization. When the face area accounts for a small proportion of the frame, disabling this option may produce better results.min_lenint (optional)The short-side pixel count of the output video, used to control the resolution. Valid values are 720 or 540, and the default is 720.
This parameter value affects billing. A 720P video costs more than a 540P video. For details, see Billing and rate limiting.
use_SRbool (optional)Whether to apply super-resolution (SR) processing to the style-transformed video. The default is false. Setting it to true improves the video quality at no extra cost.
If min_len is set to 540, enabling this option upgrades the output video to 1080P quality, but billing is still based on the 540P standard. This increases the processing time. We recommend enabling it when high-quality output is required.
  • Generate a 720P video
  • Generate a 540P video
bash
curl --location --request POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model": "video-style-transform",
    "input": {
        "video_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250704/viwndw/%E5%8E%9F%E8%A7%86%E9%A2%91.mp4"
    },
    "parameters": {
        "style": 0,
        "video_fps": 15
    }
}'

Response

outputobjectThe task output information.

Attributes

task_idstringThe task ID, the unique identifier of the task, used for subsequent queries.task_statusstringThe task status.
  • PENDING: Queued
  • RUNNING: Processing
  • SUSPENDED: Suspended
  • SUCCEEDED: Succeeded
  • FAILED: Failed
request_idstringThe unique identifier of the request. It can be used for request tracing and troubleshooting.codestringThe error code returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.messagestringThe detailed error information returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.
{
    "output": {
	  "task_id": "xxxxxxxx",
          "task_status": "PENDING"
    },
    "request_id": "7574ee8f-38a3-4b1e-9280-11c33ab46e51"
}

Step 2: Query the task status and result

GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
Task result data (such as the task status and the generated video URL) is valid for 24 hours and is automatically cleared after expiration. Make sure to query and save the results in time.

Request

Request headers
Authorizationstring (required)The authentication of the request. The API uses an Alibaba Cloud Model Studio API key for authentication. Example value: Bearer sk-xxxx.
URL path parameters
task_idstring (required)The task ID.
  • Get the task result
You need to replace {task_id} with the actual task_id.
bash
curl -X GET \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}

Response

request_idstringThe unique identifier of the request. It can be used for request tracing and troubleshooting.outputobjectThe task output information.

Attributes

output_video_urlstringThe URL of the result video. Example: http://xxx/result.mp4.task_id stringThe task ID. Valid for queries within 24 hours.task_statusstringThe task status.
  • PENDING: Queued
  • RUNNING: Processing
  • SUSPENDED: Suspended
  • SUCCEEDED: Succeeded
  • FAILED: Failed
  • UNKNOWN: The task does not exist or its status is unknown.
submit_time stringThe time when the task was submitted. Format: YYYY-MM-DD HH:mm:ss.SSS.scheduled_time stringThe time when the task was executed. Format: YYYY-MM-DD HH:mm:ss.SSS.end_time stringThe time when the task was completed. Format: YYYY-MM-DD HH:mm:ss.SSS.codestringThe error code returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.messagestringThe detailed error information returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.
usageobjectUsage statistics of the output.

Attributes

durationfloatThe duration of the generated video (in seconds).SRintThe short-side pixel value of the video used for billing (this value is the same as the min_len value you set in the request).
  • Task succeeded
  • Task running
  • Task failed
{
    "request_id": "b67df059-ca6a-9d51-afcd-xxxxxxxxxxxx",
    "output": {
        "task_id": "d76ec1e8-ea27-4038-8913-xxxxxxxxxxxx",
        "task_status": "SUCCEEDED",
        "submit_time": "2024-05-16 13:50:01.247",
        "scheduled_time": "2024-05-16 13:50:01.354",
        "end_time": "2024-05-16 13:50:27.795",
        "output_video_url": "http://xxx/result.mp4"
    },
    "usage": {
        "duration": 3,
        "SR": 720
    }
}

Billing and rate limiting

Only tasks that execute successfully are billed. The fee is calculated based on the actual duration (in seconds) of the output video and the selected resolution. Billing formula: Total fee = Output video duration (seconds) x Unit price for the corresponding resolution (the final fee will be settled strictly based on the usage object's duration and SR fields returned after the task succeeds) The free quota is deducted based on the output video duration, regardless of the video resolution.

Model name

Free quota (View)

Unit price

Rate limits (shared by the primary account and RAM sub-accounts)

QPS limit of the task submission API

Number of tasks being processed simultaneously

video-style-transform

600 seconds

720P

CNY 0.5/second

2

1

540P

CNY 0.2/second

Billing example Suppose you submit a 10-second video and select the 720P resolution for the style transform, and the video generated after the task succeeds is 10 seconds long. The fee for this task is: 10 seconds x CNY 0.5/second = CNY 5.

Error codes

If the model call fails and returns an error message, see Error codes for troubleshooting.

Appendix: More style effect demonstrations

Style nameOriginal videoStyle transform effect
Japanese manga (style=0)
American comic (style=1)
Fresh comic (style=2)
3D cartoon (style=3)
Chinese cartoon (style=4)
Paper art style (style=5)
Simple illustration (style=6)
Chinese ink wash painting (style=7)