3.0 Text-to-Video
/api/v1/video/generationHeader Parameters
Format: Authorization: Bearer sk-xxxxxx
Request Body
application/json
Fixed value k3_t2v
Model Name: kling-v3
Whether to generate a multi-shot video ● When this parameter is set to true, the prompt parameter is ignored ● When this parameter is set to false, the shot_type and multi_prompt parameters are ignored
Storyboard Mode ● Enum value: customize ● Required when the multi_shot parameter is true
Text prompt, which can include positive and negative descriptions. ● Prompts can be templated to meet various video generation requirements. The Omni model can achieve multiple capabilities by combining prompts with subjects, images, videos, and other content. ○ Use the <<<>>> format to specify a particular subject, image, or video, e.g., <<<element_1>>>, <<<image_1>>>, <<<video_1>>>. ● The length must not exceed 2,500 characters. ● When the multi_shot parameter is set to false, this parameter must not be empty. ● Supported ranges vary by model version and video mode; please refer to the capability map in this document for details.
Shot information, such as prompts and durations. ● Define the shot index and corresponding prompt and duration via the index, prompt, and duration parameters, where: ○ Up to 6 shots are supported, with a minimum of 1 shot. ○ The maximum length of content for each shot must not exceed 512. ○ The duration of each shot must not exceed the total duration of the current task and must be no less than 1. ○ The sum of the durations of all shots must equal the total duration of the current task. ● Passed in key:value format as follows: "multi_prompt": [ { "index":int, "prompt": "string", "duration": "5" }, { "index":int, "prompt": "string", "duration": "5" } ] ● When the mult_shot parameter is true and the shot_type parameter is customize, this parameter must not be empty.
Negative text prompt ● Cannot exceed 2500 characters
Whether to generate audio simultaneously during video generation ● Enum values: on, off ● This parameter is only supported by V2.6 and later models
Degree of freedom for video generation; the larger the value, the lower the model's degree of freedom and the stronger the correlation with the user's input prompt. ● Value range: [0, 1] ● The kling-v2.x model does not support this parameter.
Video generation mode ● Enum values: std, pro ● std: Standard mode, basic mode, cost-effective ● pro: Expert mode, high-performance mode, generates higher-quality videos ● Support varies by model version and video mode; 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
Duration of the generated video, in seconds ● Enum values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ● Supported ranges vary by model version and video mode; refer to the capability map in the current document for details.
Whether to simultaneously generate watermarked results ● Defined by 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 Seconds
Input Token Count
Total Token Count
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"
}