3.0 Omni Video Generation
/api/v1/video/generationHeader Parameters
Format: Authorization: Bearer sk-xxxxxx
Request Body
application/json
Fixed value k3-omni_i2v
Model Name: kling-v3-omni
Whether to generate a multi-shot video. ● When this parameter is set to true, the prompt parameter is invalid. ● When this parameter is set to false, the shot_type and multi_prompt parameters are invalid.
Storyboard mode ● Enum value: customize ● Required when the multi_shot parameter is true
Text prompts can include positive and negative descriptions. ● Prompts can be templated to meet various video generation requirements. The Omni model can achieve various capabilities through prompts combined with subjects, images, videos, and other content. ○ Use the <<<>>> format to specify a subject, image, or video, such as: <<<element_1>>>, <<<image_1>>>, <<<video_1>>>. ● The length must not exceed 2,500 characters. ● This parameter must not be empty when the multi_shot parameter is set to false. ● Support varies across different model versions and video modes; please refer to the capability map in the current documentation for details.
Information for each shot, such as prompt, duration, etc. ● Define the shot sequence number and corresponding prompt and duration through the index, prompt, and duration parameters, where: ○ A maximum of 6 shots and a minimum of 1 shot are supported. ○ The maximum length of the content related to each shot does not exceed 512. ○ The duration of each shot must not be greater than the total duration of the current task and not less than 1. ○ The sum of the durations of all shots must equal the total duration of the current task. ● Carried in key:value format as follows: "multi_prompt": [ { "index":int, "prompt": "string", "duration": "5" }, { "index":int, "prompt": "string", "duration": "5" } ] ● This parameter must not be empty when the mult_shot parameter is true and the shot_type parameter is customize.
Reference Image List ● Includes reference images for subjects, scenes, styles, etc., which can also be used as the first or last frame to generate videos; when used as the first or last frame to generate videos: ○ Use the type parameter to define whether the image is the first or last frame: first_frame for the first frame, end_frame for the last frame ○ Currently, using only the last frame is not supported, meaning a first frame image is required if a last frame image is provided ○ When generating videos from the first frame or both first and last frames, video editing features cannot be used ● Carried in key:value format, as follows: "image_list":[ { "image_url":"image_url", "type":"first_frame" }, { "image_url":"image_url", "type":"end_frame" }] ● Supports passing Base64-encoded images or image URLs (ensure accessibility) ● Supported image formats include .jpg / .jpeg / .png ● Image file size must not exceed 10MB, image width and height must be no less than 300px, and the aspect ratio must be between 1:2.5 and 2.5:1 ● When a reference video is present, the number of reference images must not exceed 4; when no reference video is present, the number of reference images must not exceed 7 ● When using the O1 model, setting the first and last frames is not supported if the array contains more than 2 images ● The image_url parameter value must not be empty
Reference Element List ● Configured based on the IDs of elements in the element library, using key:value format as follows: "element_list":[ { "element_id":long }, { "element_id":long }] ● The number of reference elements is related to the presence of reference videos and the number of reference images, specifically: ○ When generating a video from the first frame or from the first and last frames, a maximum of 3 elements are supported; ○ When a reference video is provided, the sum of reference images and reference elements must not exceed 4, and video character elements are not supported; ○ When no reference video is provided, the sum of reference images and reference elements must not exceed 7; ● Elements are divided into video-customized elements (abbreviated as video character elements) and image-customized elements (abbreviated as multi-image elements), which have different application scopes; please note the distinction ● Different model versions and video modes have different support scopes; please refer to the capability map in the current document for details.
Reference video, obtained via URL ● Can be used as a feature reference video or a video to be edited, defaulting to the video to be edited; the original audio of the video can be optionally retained ○ Use the refer_type parameter to distinguish the reference video type: feature for feature reference video, base for video to be edited ○ When the reference video is the video to be edited, the first and last frames of the video cannot be defined ○ Use the keep_original_sound parameter to choose whether to retain the original audio of the video, yes to retain, no to not retain; this parameter currently also applies to feature reference videos (feature) ● When a reference video is provided, the sound parameter value can only be off ● Carried in key:value format, as follows: "video_list":[ { "video_url":"video_url", "refer_type":"base", "keep_original_sound":"yes" }] ● Only MP4/MOV video formats are supported ● The video duration must be no less than 3 seconds, and the upper limit depends on the model version, see the capability map for details ● The video width and height dimensions must be between 720px (inclusive) and 2160px (inclusive) ● The video frame rate is based on 24fps to 60fps, and the generated video will be output at 24fps ● A maximum of 1 video can be uploaded, and the video size must not exceed 200MB ● The video_url parameter value must not be empty ● Different model versions and video modes have different support ranges, see the capability map in the current document for details
Whether to generate audio simultaneously during video generation ● Enum values: on, off ● This parameter is supported only by V2.6 and later models
Video generation mode ● Enum values: std, pro ● std: Standard mode, basic mode, cost-effective ● pro: Expert mode (high quality), high-performance mode, generates higher quality videos ● Support varies across different model versions and video modes; please refer to the capability map in the current documentation for details.
Aspect ratio (width:height) of the generated video ● Enum values: 16:9, 9:16, 1:1 ● This parameter is required when the first-frame reference or video editing feature is not used
Generated video duration, in seconds. ● Enum values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, where: ○ When using the video editing feature ("refer_type":"base"), the output duration is the same as the input video duration, and this parameter is invalid; in this case, billing is calculated based on the input video duration rounded to the nearest integer. ● Different model versions and video modes support different ranges; for details, see the capability map in the current document.
Whether to simultaneously generate results with watermarks ● Defined via the enabled parameter, the specific array format is as follows: "watermark_info": { "enabled": boolean // true to generate, false not to generate} ● Custom watermarks are not currently supported
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
Status Code
Data Object
Result Set
Usage Information
Number of Images
Video Duration in Seconds
Input Tokens
Total Tokens
Output Token Count
Validity Period
Task ID
Task Status
Status Information
Request ID
curl -X POST "https://api.ygw.ai/api/v1/video/generation" \ -H "Authorization: string" \ -H "Content-Type: application/json" \ -d '{ "_action": "string", "model": "string" }'{
"code": 0,
"data": {
"urls": [
"string"
],
"usage": {
"images": 0,
"seconds": 0,
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0
},
"expired": "string",
"task_id": "string",
"task_status": "string"
},
"message": "string",
"request_id": "string"
}