Text-to-Video

AliCloud AI platform providing access to Wan video generation models.

POSThttps://api.cloudwise.ai/api/v1/services/aigc/video-generation/video-synthesis

Overview

This endpoint provides text-to-video generation functionality. Generate high-quality video content from text prompts with support for various resolutions, durations, and advanced features like prompt enhancement, multi-shot narratives, and audio synchronization. The API supports asynchronous processing and returns a task ID that can be used to query the generation status and retrieve the final video.

Headers

This endpoint requires specific headers for authentication and content type.

ParameterTypeDefaultDescription
Content-Typestring-required
Request content type. This parameter must be set to application/json.
Authorizationstring-required
Request authentication. The API uses cloudwise-maas API-Key for authentication. Example: Bearer ak-xxxx.
X-DashScope-Asyncstring-required
Asynchronous processing configuration parameter. HTTP requests only support asynchronous mode, must be set to enable.

Request Body

ParameterTypeDefaultDescription
modelstring-required
Model name. Example: wan2.5-t2v-preview
inputobject-required
Basic input information, such as prompts.
input.promptstring-Text prompt. Used to describe the elements and visual characteristics expected in the generated video.
Each character counts as one character, excess parts will be automatically truncated. Maximum length: 1500 characters.
When using video effect parameters (i.e., template is not empty), the prompt parameter is invalid and does not need to be filled.
Example: A little cat running on the grass.
input.negative_promptstring-Negative prompt, used to describe content that should not appear in the video, which can restrict the video content.
Maximum length: 500 characters, excess parts will be automatically truncated.
Example: Low resolution, errors, worst quality, low quality, incomplete, extra fingers, bad proportions, etc.
input.audio_urlstring-Supported models: wan2.6-i2v, wan2.5-i2v-preview.
URL of the audio file. The model will use this audio to generate the video.
Supports HTTP or HTTPS protocols. Local files can obtain temporary URLs by uploading files.
Audio restrictions:
- Format: wav, mp3.
- Duration: 3-30s.
- File size: not exceeding 15MB.
- Over-limit handling: If the audio length exceeds the duration value (5 seconds or 10 seconds), automatically take the first 5 seconds or 10 seconds, and discard the rest. If the audio length is less than the video duration, the part beyond the audio length will be silent video. For example, if the audio is 3 seconds and the video duration is 5 seconds, the output video will have sound for the first 3 seconds and be silent for the last 2 seconds.
Example: https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3.
parametersobject-Video processing parameters, such as setting video resolution, duration, enabling prompt intelligent rewriting, adding watermarks, etc.
parameters.sizestring1920*1080 (1080P)Specify the generated video resolution, formatted as width*height. The default value and available enum values of this parameter depend on the model parameter, with the following rules:
- wan2.6-t2v: Default value is 1920*1080 (1080P). Optional resolutions: All resolutions corresponding to 720P and 1080P.
- wan2.5-t2v-preview: Default value is 1920*1080 (1080P). Optional resolutions: All resolutions corresponding to 480P, 720P, and 1080P.
480P tier: Optional video resolutions and their corresponding video aspect ratios:
- 832*480: 16:9
- 480*832: 9:16
- 624*624: 1:1
720P tier: Optional video resolutions and their corresponding video aspect ratios:
- 1280*720: 16:9
- 720*1280: 9:16
- 960*960: 1:1
- 1088*832: 4:3
- 832*1088: 3:4
1080P tier: Optional video resolutions and their corresponding video aspect ratios:
- 1920*1080: 16:9
- 1080*1920: 9:16
- 1440*1440: 1:1
- 1632*1248: 4:3
- 1248*1632: 3:4
parameters.durationinteger5Duration of the generated video, in seconds. The value of this parameter depends on the model parameter:
- wan2.6-t2v: Optional values are 5, 10, 15. Default value is 5.
- wan2.5-t2v-preview: Optional values are 5, 10. Default value is 5.
Example: 5
parameters.prompt_extendbooleantrueWhether to enable prompt intelligent rewriting. When enabled, use a large model to intelligently rewrite the input prompt. This significantly improves the generation effect for shorter prompts, but will increase processing time.
- true: Default value, enable intelligent rewriting.
- false: Do not enable intelligent rewriting.
Example: true
parameters.shot_typestringsingleSupported models: wan2.6-t2v.
Specify the shot type of the generated video, i.e., whether the video consists of one continuous shot or multiple switching shots.
Effective condition: Only takes effect when "prompt_extend": true.
Parameter priority: shot_type > prompt. For example, if shot_type is set to "single", even if the prompt contains "generate multi-shot video", the model will still output a single-shot video.
Optional values:
- single: Default value, output single-shot video
- multi: Output multi-shot video.
Example: single
parameters.watermarkbooleanfalseWhether to add a watermark identifier. The watermark is located in the lower right corner of the video, and the text is fixed as "AI生成".
- false: Default value, do not add watermark.
- true: Add watermark.
Example: false
parameters.seedinteger-Random seed, value range is [0, 2147483647].
When not specified, the system automatically generates a random seed. If you need to improve the reproducibility of generation results, it is recommended to fix the seed value.
Please note that due to the probabilistic nature of model generation, even using the same seed cannot guarantee completely consistent generation results each time.
Example: 12345

Request Example

curl -X POST 'https://api.cloudwise.ai/api/v1/services/aigc/video-generation/video-synthesis' \
--header 'X-DashScope-Async: enable' \
--header 'Authorization: Bearer $YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "wan2.5-t2v-preview",
    "input": {
        "prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages.",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3"
    },
    "parameters": {
        "size": "1280*720",
        "prompt_extend": true,
        "duration": 10
    }
}'

Response

The response contains the generated video task information.

Response Fields

FieldTypeDescription
outputobjectTask output information
output.task_idstringTask ID. Query validity period is 24 hours.
output.task_statusstringTask status.
Enum values:
- PENDING: Task queued
- RUNNING: Task processing
- SUCCEEDED: Task execution successful
- FAILED: Task execution failed
- CANCELED: Task canceled
- UNKNOWN: Task does not exist or status unknown
request_idstringRequest ID for tracking

Response Example

{
  "output": {
    "task_id": "M************************************==",
    "task_status": "PENDING"
  },
  "request_id": "2d081967-5e3b-9d92-80da-dbd0f0488b87"
}