Kling AI native text-to-video generation. Official docs: https://app.klingai.com/cn/dev/document-api/apiReference/commonInfoSubmit a text description and get a video generation task. Poll the task status endpoint to check for completion and retrieve the final video URL.
Request
Authorization
API Key
Add parameter in header
Authorization
Example:
Authorization: ********************
or
Body Params application/jsonRequired
Example
{"model_name":"kling-v1","prompt":"A cat playing piano in the garden","negative_prompt":"string","cfg_scale":0.7,"mode":"std","camera_control":{"type":"simple","config":{"horizontal":0,"vertical":0,"pan":0,"tilt":0,"roll":0,"zoom":0}},"aspect_ratio":"16:9","duration":"5","callback_url":"string","external_task_id":"string"}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location--request POST 'https://api.ccapi.ai//kling/v1/videos/text2video' \
--header'Authorization: <api-key>' \
--header'Content-Type: application/json' \
--data-raw'{
"model_name": "kling-v1",
"prompt": "A cat playing piano in the garden",
"negative_prompt": "string",
"cfg_scale": 0.7,
"mode": "std",
"camera_control": {
"type": "simple",
"config": {
"horizontal": 0,
"vertical": 0,
"pan": 0,
"tilt": 0,
"roll": 0,
"zoom": 0
}
},
"aspect_ratio": "16:9",
"duration": "5",
"callback_url": "string",
"external_task_id": "string"
}'