image_url
is left null then the task would be a text-to-video task; if filled out, then the task would be an image-to-video task.extend_video
and include origin_task_id
filed in input
; if you want lipsync, use lip_sync
and include origin_task_id
in input
task_type
.refer to the example for more details.image_url
.lip_sync
task only; will be ignored if local_dubbing_url
is setlip_sync
task with valid tts_text
only.lip_sync
task with valid ttx_text
, the full voice name list and demo list here: https://klingai.com/api/lip/sync/ttsList?type=mp3``wav``flac``ogg
, should be less than 20 MB and shorter than 60 seconds. After the audio is submitted, we will trim it to the exact length of the original video.public
->Pay As You Go(PAYG)
private
->Host Your Account(HYA)
{
"model": "kling",
"task_type": "video_generation",
"input": {
"prompt": "White egrets fly over the vast paddy fields",
"negative_prompt": "",
"cfg_scale": 0.5,
"duration": 5,
"aspect_ratio": "1:1",
"camera_control": {
"type": "simple",
"config": {
"horizontal": 0,
"vertical": 0,
"pan": -10,
"tilt": 0,
"roll": 0,
"zoom": 0
}
},
"mode": "std"
},
"config": {
"service_mode": "",
"webhook_config": {
"endpoint": "",
"secret": ""
}
}
}
curl --location --request POST 'https://api.piapi.ai/api/v1/task' \
--header 'x-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kling",
"task_type": "video_generation",
"input": {
"prompt": "White egrets fly over the vast paddy fields",
"negative_prompt": "",
"cfg_scale": 0.5,
"duration": 5,
"aspect_ratio": "1:1",
"camera_control": {
"type": "simple",
"config": {
"horizontal": 0,
"vertical": 0,
"pan": -10,
"tilt": 0,
"roll": 0,
"zoom": 0
}
},
"mode": "std"
},
"config": {
"service_mode": "",
"webhook_config": {
"endpoint": "",
"secret": ""
}
}
}'
{
"code": 200,
"data": {
"task_id": "6e269e8c-2091-46c4-b4a5-40a4704a766a",
"model": "kling",
"task_type": "video_generation",
"status": "",// pending/processing/failed/completed
"config": {
"service_mode": "public",
"webhook_config": {
"endpoint": "",
"secret": ""
}
},
"input": {},
"output": {
"video_url": ""
},
"meta": {},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
},
"message": "success"
}