Generate Video
POST /v1/platform/video
Submit an AI video generation task. Supports text-to-video, image-to-video, video continuation and more. Tasks execute asynchronously, returns task_id. Poll for results via the Query Task API
⚠️ File URLs generated by this API are only retained for 7 days. Please download and save them promptly.
⚠️ The video API parameters are highly similar to the image API. The main difference is: model must start with video-; each item in inputs adds
category,reference_typeand other video-specific fields; output addsduration,audio_generationand other fields.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Model identifier, must start with video-. Format: video-{model_name}-{version}, e.g. video-kling-2.1. |
prompt | string | Required | Text description for video generation. Describe scene content, actions, style, etc. |
negative_prompt | string | Optional | Negative prompt describing content you don't want in the video. |
enhance_prompt | string | Optional | Whether to enable automatic prompt enhancement. 可选值: enabled / disabled |
generation_mode | string | Optional | Generation mode, e.g. text-to-video, image-to-video. Available values depend on the model. |
inputs | array | Optional | List of input files. Can include reference images, reference videos, or tail frame images. ↳ inputs[i] child fields |
subject_inputs | array | Optional | List of subject reference images for consistent character generation (supported by Kling / Vidu). ↳ subject_inputs[i] child fields |
output | object | Optional | Output configuration controlling video duration, audio, resolution, etc. ↳ output child fields (includes all image API fields; below are video-specific additions) |
scene_type | string | Optional | Scene type for generation optimization in specific scenarios: • Kling: motion_control(motion control)、avatar_i2v(digital human)、lip_sync(lip sync)• Vidu: template_effect(special effects template) |
input_region | string | Optional | Source region of input material. 可选值: mainland / oversea |
session_id | string | Optional | Deduplication identifier. If a request with the same session_id was made within 3 days, this request returns an error. Max 50 characters. Leave empty to skip deduplication. |
session_context | string | Optional | Source context for passing user request info. The field value is returned in task callbacks. Max 1000 characters. |
ext_info | object | Optional | Reserved field for special purposes. The specific format is determined by the model used. |
inputs[i] child fields
| Field Name | Type | Required | Description |
|---|---|---|---|
url | string | Required | Publicly accessible URL of the input material. Recommend images under 10 MB. Supported formats: jpeg, jpg, png. |
category | string | Optional | File category. 可选值: image / video |
reference_type | string | Optional | Reference type. GV model: asset (material reference), style (style reference). Kling model when category is video: feature (feature reference video), base (video to be edited). |
object_id | string | Optional | Subject ID, applicable to Vidu-q2 model. Fill in when identifying a subject in the image; can be referenced via @subjectID. Valid when category is image. |
voice_id | string | Optional | Voice ID, applicable to Vidu-q2 model. When all images carry a subject ID, you can assign a voice to each subject. Valid when category is image. |
keep_original_sound | string | Optional | Whether to preserve the original audio track of the input video. Valid when category is video.可选值: enabled / disabled |
usage | string | Optional | Purpose of the input file, used to distinguish first-frame, last-frame, or reference generation. Default: reference.可选值: firstFrame / reference / lastFramefirstFrame: first frame for first/last-frame video or image-to-video; reference: reference-guided video; lastFrame: last frame for first/last-frame video. |
text | string | Optional | Subject name, only valid for PixVerse multi-image (subject) reference mode. Referenced in the Prompt via @Text, e.g. @cat running. |
subject_inputs[i] child fields
| Field Name | Type | Required | Description |
|---|---|---|---|
url | string | Required | Publicly accessible URL of the subject reference image. |
id | string | Optional | Fixed subject ID. Kling: Required; Vidu: Optional. |
name | string | Optional | Fixed subject name. Vidu: Required; Kling: Optional. |
output child fields (includes all image API fields; below are video-specific additions)
| Field Name | Type | Required | Description |
|---|---|---|---|
duration | integer | Optional | Duration of the generated video in seconds. Available values per model: • Kling: 5、10,Default 5• Hailuo: 6、10,Default 6• Vidu: 1~10• GV: 8,Default 8• OS: 4、8、12,Default 8 |
resolution | string | Optional | Resolution of the generated video. Available values per model: • Kling: 720P、1080P,Default 720P• Hailuo: 768P、1080P,Default 768P• Vidu: 720P、1080P,Default 720P• GV: 720P、1080P,Default 720P• OS: 720P |
aspect_ratio | string | Optional | Specify the aspect ratio of the generated video. Available values per model: • Kling (text-to-video): 16:9、9:16、1:1,Default 16:9• Vidu (text-to-video / reference image): 16:9、9:16、4:3、3:4、1:1 (q2 only supports 4:3, 3:4)• GV: 16:9、9:16,Default 16:9• OS (text-to-video): 16:9、9:16,Default 16:9• Hailuo:Not supported yet |
audio_generation | string | Optional | Whether to generate audio. Supported models:GV、OS、Vidu。Default: disabled. Equivalent to the boolean audio field; this field takes priority.可选值: enabled / disabled |
audio | boolean | Optional | audio_generation Shorthand for audio_generation. Setting true is equivalent to "enabled". Ignored if audio_generation is already set. |
enhance_switch | string | Optional | Whether to enable video enhancement. When the selected resolution exceeds the model's native capability, enhancement is enabled by default. You may output at lower resolution and apply enhancement to achieve higher resolution. 可选值: enabled / disabled |
frame_interpolate | string | Optional | Whether to enable Vidu smart frame interpolation for smoother video. Currently only supports the Vidu model. 可选值: enabled / disabled |
media_name | string | Optional | Output media filename, max 64 characters. Defaults to a system-generated filename. |
class_id | integer | Optional | Category ID for media classification management. Default: 0 (other). |
Request Example
JSON (Text-to-Video)
{
"model": "video-jimeng-3.0pro",
"prompt": "A cat running on the beach, golden sunset, slow motion",
"enhance_prompt": "enabled",
"output": {
"duration": 5,
"aspect_ratio": "16:9",
"audio_generation": "enabled",
"frame_interpolate":"enabled",
}
}
JSON (Image-to-Video with head/tail frames)
{
"model": "video-kling-2.1",
"prompt": "Camera slowly zooms in, flowers gently swaying in the breeze",
"inputs": [
{
"url": "https://example.com/first-frame.jpg",
"category":"image"
},
{
"url": "https://example.com/last-frame.jpg",
"category":"last_frame"
}
],
"output": {
"duration": 5,
"aspect_ratio": "16:9"
}
}
Response Parameters
| Field Name | Type | Description |
|---|---|---|
task_id | string | Unique task ID for subsequent task status queries. |
status | string | Initial task status, usually queued. |