Skip to content

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 NameTypeRequiredDescriptionExample
Content-TypestringOptionalapplication/json
AuthorizationstringOptionalBearer {{YOUR_API_KEY}}

Body Parameters (application/json)

Parameter NameTypeRequiredDescription
session_idstringRequiredSession ID, generated based on the lip sync face recognition interface
face_choosearray[object]RequiredSpecify face for lip sync; includes face ID, lip shape reference, etc.; currently only supports single person lip sync
  └ face_idstringRequiredFace ID returned by the face recognition interface
  └ audio_idstringOptionalID 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_filestringOptionalAudio 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_timeintegerRequiredAudio 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_timeintegerRequiredAudio trim end time. End time must not be later than the total duration of the original audio
  └ sound_insert_timeintegerRequiredTrimmed 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_volumeintegerRequiredAudio volume size; larger values mean louder volume. Value range: [0, 2]
  └ original_audio_volumeintegerRequiredOriginal 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_idstringOptional
callback_urlstringOptional

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
{}