Theme
Lip Sync
POST
https://www.kkiai.com/kling/v1/videos/advanced-lip-sync
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 |
|---|---|---|---|
session_id | string | Required | Session ID, generated based on the lip sync face recognition interface |
face_choose | array[object] | Required | Specify face for lip sync; includes face ID, lip shape reference, etc.; currently only supports single person lip sync |
└ face_id | string | Required | Face ID returned by the face recognition interface |
└ audio_id | string | Optional | ID of audio generated through the preview interface. Only supports audio generated within 30 days, with duration not less than 2 seconds and not exceeding 60 seconds. audio_id and sound_file parameters are mutually exclusive; cannot both be empty or both have values |
└ sound_file | string | Optional | Audio file. Supports audio Base64 encoding or audio URL (ensure accessibility). Audio file supports .mp3/.wav/.m4a, file size not exceeding 5MB. Format mismatch or oversized files will return error codes. Only supports audio with duration not less than 2 seconds and not exceeding 60 seconds. audio_id and sound_file parameters are mutually exclusive; cannot both be empty or both have values. The system will validate audio content and return error codes if there are issues |
└ sound_start_time | integer | Required | Audio trim start time; based on the original audio start time, start time is 0 minutes 0 seconds, unit is ms; audio before the start point will be trimmed, trimmed audio must not be shorter than 2 seconds |
└ sound_end_time | integer | Required | Audio trim end time. End time must not be later than the total duration of the original audio |
└ sound_insert_time | integer | Required | Trimmed audio insertion time. The time range of inserted audio must overlap with the face's lip sync time interval by at least 2 seconds. The start time of inserted audio must not be earlier than the video start time, and the end time must not be later than the video end time |
└ sound_volume | integer | Required | Audio volume size; larger values mean louder volume. Value range: [0, 2] |
└ original_audio_volume | integer | Required | Original video volume size; larger values mean louder volume. Value range: [0, 2]; this parameter has no effect when the original video is silent |
external_task_id | string | Optional | |
callback_url | string | Optional |
Request Example
json
{
"session_id": "825465778199224380",
"face_choose": [
{
"face_id": "-1",
"audio_id": "825451760499568680",
"sound_file": "",
"sound_start_time": 0,
"sound_end_time": 5000,
"sound_insert_time": 1000,
"sound_volume": 1.0,
"original_audio_volume": 1.0
}
],
"external_task_id": "",
"callback_url": ""
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/kling/v1/videos/advanced-lip-sync' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"session_id": "825465778199224380",
"face_choose": [
{
"face_id": "-1",
"audio_id": "825451760499568680",
"sound_file": "",
"sound_start_time": 0,
"sound_end_time": 5000,
"sound_insert_time": 1000,
"sound_volume": 1.0,
"original_audio_volume": 1.0
}
],
"external_task_id": "",
"callback_url": ""
}'Response
🟢 200 Success
Response Example
json
{}