Create Task
POST
/ent/v2/templateQuery Creations
GET
/ent/v2/tasks/{id}/creationsOne-click Solutions
Authorizationstring*Replace {your api key} with your token
Token {your_api_key}Token {your_api_key}templatestring*Fixed Value: motion_control_2\motion_control_2.5
huggingimagesstring*User Input Image• : JPG、JPEG、PNG• : The width and height of the image are within the range of [300, 4096] pixels, and the aspect ratio is in the range of 1:2.5 to 2.5:1.• : <= 50MB。• : There is only one person in the picture, facing the camera, with a complete and unobstructed face, and a moderate proportion in the picture to avoid being too large or too small.
Authorizationstring*Replace {your api key} with your token
Token {your api key}idstring*The ID of the task, taken from the path.
{your_id}idstring*Task ID, returned upon successful creation by the Create Task API
data:image/pngvideo_urlsstringUser Input Reference Action Video
• File Format: MP4、MOV。
• Duration: 3~30s。
• Aspect_ratio: The width and height of the video are within the range of [200, 2048] pixels, with an aspect ratio ranging from 1:2.5 to 2.5:1.
• File Size: <= 100MB。
• Content: There is only one person in the picture, facing the camera, with a complete and unobstructed face, and a moderate proportion in the picture to avoid being too large or too small.
Video content\n画面中的两个主体转向彼此,并开始拥抱# 要求\n将Motion Level设置为‘Large’payloadstringtransparent transmission parameters
No processing, only data transmission, with a maximum length of 1048576 characters
callback_urlstringCallback
When creating a task, you need to actively set the callback_url with a POST request. When the video generation task changes its status, Vidu will send a callback request to this URL, containing the latest status of the task. The structure of the callback request content will be the same as the return body of the Get Generation API.
The "status" in the callback response includes the following states:
- processing: Task is being processed.
- success: Task is completed (if sending fails, it will retry the callback three times).
- failed: Task failed (if sending fails, it will retry the callback three times).
Vidu uses a callback signature algorithm for verification, check out the details here: Callback Signature
application/jsonResponse fields
task_idstringVidu task_id
statestringIt will be returned to a specific processing state:
- created created task successfully
- queueing task in queue
- processing processing
- success generation successful
- failed task failed
video_urlstringThe video used for this call
application/jsonResponse fields
idstringTask ID
statestringProcessing status
Available values:
created Created successfully
queueing Task is queued
processing Task is processing
success Task succeeded
failed Task failed
err_codestringError code, see the error code table for details
creditsintegerNumber of credits consumed by this task, unit: credits
image_urlstringThe image used for this call
payloadstringThe payload parameter used for this call
creditsintegerThe credits used for this call
created_atstringTask creation time
payloadThe pass-through parameter passed in this task call
bgmbooleanWhether BGM was used in this task call
off_peakbooleanWhether off-peak mode was used in this task call
creationsarrayGeneration results
idstringGeneration result ID, used to identify different generation results
urlstringGeneration result URL, valid for 24 hours
cover_urlstringGeneration result cover, valid for 24 hours
watermarked_urlstringWatermarked generation result URL, valid for 24 hours
curl --request POST \
--url 'https://api.vidu.cn/ent/v2/template' \
--header 'Authorization: Token {your_api_key}' \
--header 'Content-Type: application/json' \
--data '{
"template": "hugging",
"images": "data:image/png",
"video_urls": "Video content\\n画面中的两个主体转向彼此,并开始拥抱# 要求\\n将Motion Level设置为‘Large’",
"payload": "string",
"callback_url": "string"
}'{
"task_id": "your_task_id_here",
"state": "created",
"image_url": "your_image_url",
"video_url": "your_video_url",
"payload":"",
"credits":credits_number,
"created_at": "2025-01-01T15:41:31.968916Z"
}curl --request GET \
--url 'https://api.vidu.com/ent/v2/tasks/{your_id}/creations' \
--header 'Authorization: Token {your api key}' \
--header 'Content-Type: application/json'{
"id":"your_task_id",
"state": "success",
"err_code": "",
"credits": 4,
"payload": "",
"creations": [
{
"id": "your_creations_id",
"url": "your_generated_results_url",
"cover_url": "your_generated_results_cover_url",
"watermarked_url": "your_generated_results_watermarked_url"
}
]
}