Video style transform API Reference

Updated at:

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.

ImportantThis 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.

ImportantIf 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.

NoteThis 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.

NoteIf 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

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
    }
}'
import requests
import os

DASHSCOPE_API_KEY = os.getenv("DASHSCOPE_API_KEY")
# 替换为你的视频 URL
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"

response = requests.post(
            "https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis",
            headers={
                "Authorization": f"Bearer {DASHSCOPE_API_KEY}",
                "X-DashScope-Async": "enable",
            },
            json={
            "model": "video-style-transform",
            "input": {
                "video_url": video_url
            },
            "parameters": {
                "style": 0,
                "video_fps": 15
            }
        }
        )
print(response.json())

Generate a 540P video

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,
        "min_len": 540
    }
}'
import requests
import os

DASHSCOPE_API_KEY = os.getenv("DASHSCOPE_API_KEY")
# 替换为你的视频 URL
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"

response = requests.post(
            "https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis",
            headers={
                "Authorization": f"Bearer {DASHSCOPE_API_KEY}",
                "X-DashScope-Async": "enable",
            },
            json={
            "model": "video-style-transform",
            "input": {
                "video_url": video_url
            },
            "parameters": {
                "style": 0,
                "video_fps": 15,
                "min_len": 540
            }
        }
        )
print(response.json())

Response

outputobject

The task output information.

Attributes

task_idstring

The task ID, the unique identifier of the task, used for subsequent queries.

task_statusstring

The task status.

  • PENDING: Queued
  • RUNNING: Processing
  • SUSPENDED: Suspended
  • SUCCEEDED: Succeeded
  • FAILED: Failed

request_idstring

The unique identifier of the request. It can be used for request tracing and troubleshooting.

codestring

The error code returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.

messagestring

The 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"
}
{
    "code":"InvalidApiKey",
    "message":"Invalid API-key provided.",
    "request_id":"fb53c4ec-1c12-4fc4-a580-xxxxxxxxxxxx"
}

Step 2: Query the task status and result

GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}

ImportantTask 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.

curl -X GET \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
import requests
import os

DASHSCOPE_API_KEY = os.getenv("DASHSCOPE_API_KEY")
# task_id 请替换为你的 task_id
task_id = "0c9c33e6-b2e7-41e5-*********"

task_response = requests.get(
        f"https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}",
        headers={
            "Authorization": f"Bearer {DASHSCOPE_API_KEY}"
        })
print(task_response.json())

Response

request_idstring

The unique identifier of the request. It can be used for request tracing and troubleshooting.

outputobject

The task output information.

Attributes

output_video_urlstring

The URL of the result video. Example: http://xxx/result.mp4.

task_id string

The task ID. Valid for queries within 24 hours.

task_statusstring

The 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 string

The time when the task was submitted. Format: YYYY-MM-DD HH:mm:ss.SSS.

scheduled_time string

The time when the task was executed. Format: YYYY-MM-DD HH:mm:ss.SSS.

end_time string

The time when the task was completed. Format: YYYY-MM-DD HH:mm:ss.SSS.

codestring

The error code returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.

messagestring

The detailed error information returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.

usageobject

Usage statistics of the output.

Attributes

durationfloat

The duration of the generated video (in seconds).

SRint

The 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

{
    "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
    }
}

Task running

After a task is submitted, it is in the queued state. Once scheduled, it changes to the running state, and the task status is RUNNING;

{
    "request_id":"e5d70b02-ebd3-98ce-9fe8-xxxxxxxxxxxx",
    "output":{
        "task_id":"13b1848b-5493-4c0e-xxxxxxxxxxxx",
        "task_status":"RUNNING",
        "submit_time":"2025-09-08 15:53:13.143",
        "scheduled_time":"2025-09-08 15:53:13.169"
    }
}

Task failed

{
    "request_id": "dccfdf23-b38e-97a6-a07b-xxxxxxxxxxxx",
    "output": {
        "task_id": "4cbabbdf-2c1f-43f4-b983-xxxxxxxxxxxx",
        "task_status": "FAILED",
        "submit_time": "2024-05-16 14:15:14.103",
        "scheduled_time": "2024-05-16 14:15:14.154",
        "end_time": "2024-05-16 14:15:14.694",
        "code": "InvalidParameter.FileDownload",
        "message": "download for input video error"
    }
}

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)