Overview
This API is used to create a video generation task. It supports various video generation scenarios, such as text-to-video and image-to-video, and only supports asynchronous mode. You must set X-Async: enable when calling this API. After it returns the task ID, you can query the task details at /api/v1/tasks/{task_id}.
API details
Constraints
- The caller must have an API Key. For more information, see Manage AI API Keys.
Request path
POST {BASE_URL}/api/v1/videos/generations
Request header
Name |
Required |
Example value |
Description |
|---|---|---|---|
| Authorization | Yes | Bearer {token} | Authentication information |
| Content-Type | No | application/json | Request body format |
| X-Async | Yes | enable | Video generation is supported only forenable. |
Request parameters
Path
None
Query
None
Body
Name |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| model | string | Yes | Model name. The following models are supported: - Volcano Engine video generation model (for example, doubao-video-v1) - Bailian video generation model (for example, wanx-video-v1) For the specific model list, refer to the document of the corresponding vendor: Volcano Engine, Bailian |
Response
Response parameters
Name |
Type |
Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| code | string | Return code |
| message | string | Response parameters |
| data | object | Business response data |
data
Name |
Type |
Description |
|---|---|---|
| task_id | string | Task ID, used to query the task status later. |
Request example
curl --request POST '{BASE_URL}/api/v1/videos/generations' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--header 'X-Async: enable' \
--data '{
"model": "doubao-video-v1"
}'
Response example
{
"success": true,
"code": "200",
"message": "successful",
"data": {
"task_id": "task-1234567890abcdef"
}
}
