Theme
Text to Video
POST
https://www.kkiai.com/kling/v1/videos/text2video
Request Parameters
Authorization
Add the Authorization parameter to the Header. Its value is the Token concatenated after Bearer.
Example: Authorization: Bearer ********************
Header Parameters
| Parameter Name | Type | Required | Description | Example |
|---|---|---|---|---|
Content-Type | string | Optional | application/json | |
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
model_name | string | Required | Model name. Enum values: kling-v1, kling-v1-6, kling-v2-master, kling-v2-1-master, kling-v2-5-turbo, kling-v3 |
prompt | string | Optional | Positive text prompt. Cannot exceed 2500 characters. |
multi_shot | boolean | Required | Whether to generate multi-shot video. When this parameter is true, the prompt parameter is invalid. When this parameter is false, the shot_type parameter and multi_prompt parameter are invalid. |
shot_type | string | Optional | Shot composition method. Enum values: customize. Required when multi_shot parameter is true. |
multi_prompt | array[object] | Optional | Information for each shot, such as prompt and duration. ● Define shot sequence number, corresponding prompt, and duration through index, prompt, and duration parameters, where: ○ Maximum 6 shots supported, minimum 1 shot. ○ Maximum length of content for each shot does not exceed 512 characters. ○ Duration of each shot must not exceed the total task duration and must not be less than 1 second. ○ The sum of durations of all shots equals the total task duration. |
└ index | integer | Required | |
└ prompt | string | Required | |
└ duration | string | Required | |
negative_prompt | string | Optional | Negative text prompt. Cannot exceed 2500 characters. |
cfg_scale | number | Optional | Degree of freedom for video generation. The larger the value, the smaller the model's degree of freedom, and the stronger the correlation with the user's input prompt. |
mode | string | Required | Video generation mode. Enum values: std, pro. std: Standard mode (standard), basic mode, high cost-effectiveness. pro: Expert mode (high quality), high performance mode, generates better video quality. |
sound | string | Optional | Whether to generate sound simultaneously when generating video. Enum values: on, off. This parameter is only supported by V2.6 and later model versions. |
camera_control | object | Optional | Protocol for controlling camera movement (if not specified, the model will intelligently match based on the input text/image). |
└ type | string | Required | |
└ config | object | Required | |
aspect_ratio | string | Optional | Aspect ratio of the generated video (width:height). |
duration | string | Required | Duration of generated video in seconds. |
watermark_info | object | Optional | Whether to generate results with watermark simultaneously. ● Define through the enabled parameter, carried by key:value as follows: "watermark_info": { "enabled": boolean // true to generate, false to not generate } |
└ enabled | boolean | Required | |
callback_url | string | Optional | |
external_task_id | string | Optional |
Request Example
json
{
"model_name": "kling-v1",
"prompt": "Generate a video of a person dancing by the seaside.",
"negative_prompt": "",
"cfg_scale": 0.5,
"mode": "std",
"sound": "off",
"camera_control": {
"type": "simple",
"config": {
"horizontal": 1.0,
"vertical": 0,
"pan": 0,
"tilt": 0,
"roll": 0,
"zoom": 0
}
},
"aspect_ratio": "16:9",
"duration": "5",
"callback_url": "",
"external_task_id": ""
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/kling/v1/videos/text2video' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model_name": "kling-v1",
"prompt": "Generate a video of a person dancing by the seaside.",
"negative_prompt": "",
"cfg_scale": 0.5,
"mode": "std",
"sound": "off",
"camera_control": {
"type": "simple",
"config": {
"horizontal": 1.0,
"vertical": 0,
"pan": 0,
"tilt": 0,
"roll": 0,
"zoom": 0
}
},
"aspect_ratio": "16:9",
"duration": "5",
"callback_url": "",
"external_task_id": ""
}'Response
🟢 200 Success
Response Example
json
{
"code": 0,
"message": "SUCCEED",
"request_id": "603e2a28-fb89-4146-ae33-412d74012a6d",
"data": {
"task_id": "831922345719271433",
"task_status": "submitted",
"task_info": {},
"created_at": 1766374262370,
"updated_at": 1766374262370
}
}