Skip to main content
Use the Face Recognition tab first to obtain session_id and face_id, then submit them in the Lip Sync tab. The audio input is either face_choose[].audio_id or face_choose[].sound_file. To start from text, first call Kling Digital Human TTS and use the returned audio id.

Create task

POST /kling/v1/videos/advanced-lip-sync
cURL

Request headers

string
required
Bearer authentication in the form Bearer YOUR_API_KEY.
string
default:"application/json"
required
Data exchange format.

Request body

string
required
Session ID returned by Identify Face.
object[]
required
Face and driving-audio configuration. Provide exactly one item.
string
required
Face ID returned in data.face_data[].face_id by Identify Face.
string
Audio ID created within the last 30 days. The selected audio must be 2–60 seconds. Provide exactly one of audio_id and sound_file.
string
Public audio URL or raw Base64. MP3, WAV, and M4A are supported through AnyFast; maximum size 5 MB and duration 2–60 seconds. Provide exactly one of sound_file and audio_id.
integer
required
Crop start in the source audio, in milliseconds.
integer
required
Crop end in the source audio, in milliseconds. It must not exceed the source audio duration.
integer
required
Insertion point in the video, in milliseconds. The inserted segment must remain inside the video and overlap the selected face by at least 2 seconds.
number
default:1
Inserted-audio volume from 0 through 2.
number
default:1
Original-video volume from 0 through 2.
object
Watermark configuration.
boolean
Whether to generate a watermarked result.
string
Public callback URL for task-status notifications.

Create response

200
integer
Business result code. 0 indicates acceptance.
string
Business message. It can be empty on success.
string
Request ID field. It can be empty.
string
AnyFast task ID used to query the result.
string
Initial task status. An accepted task returns submitted.
integer
Creation time as a Unix timestamp in milliseconds.
integer
Update time as a Unix timestamp in milliseconds.

Query task

GET /kling/v1/videos/advanced-lip-sync/{task_id}
cURL

Request headers and path

string
required
Bearer authentication in the form Bearer YOUR_API_KEY.
string
required
AnyFast task ID returned by task creation.

Response

200
integer
Business result code. 0 indicates success.
string
Business message. It can be empty on success.
string
AnyFast task ID.
string
Task status: submitted, processing, succeed, or failed.
string
Failure details when the task fails.
object[]
Generated video results. Present when the task succeeds.
string
Generated video URL.
string
Reported video duration in seconds.
integer
Creation time as a Unix timestamp in milliseconds.
integer
Update time as a Unix timestamp in milliseconds.