Create Lip Sync Task
curl --request POST \
--url https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"session_id": "abc123-session-id",
"face_image_url": "https://example.com/face.jpg",
"text": "你好,欢迎来到我的频道",
"voice_id": "girlfriend_1_cn",
"voice_language": "zh",
"audio_url": "https://example.com/speech.mp3"
}
}
'import requests
url = "https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync"
payload = { "input": {
"session_id": "abc123-session-id",
"face_image_url": "https://example.com/face.jpg",
"text": "你好,欢迎来到我的频道",
"voice_id": "girlfriend_1_cn",
"voice_language": "zh",
"audio_url": "https://example.com/speech.mp3"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
session_id: 'abc123-session-id',
face_image_url: 'https://example.com/face.jpg',
text: '你好,欢迎来到我的频道',
voice_id: 'girlfriend_1_cn',
voice_language: 'zh',
audio_url: 'https://example.com/speech.mp3'
}
})
};
fetch('https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'session_id' => 'abc123-session-id',
'face_image_url' => 'https://example.com/face.jpg',
'text' => '你好,欢迎来到我的频道',
'voice_id' => 'girlfriend_1_cn',
'voice_language' => 'zh',
'audio_url' => 'https://example.com/speech.mp3'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync"
payload := strings.NewReader("{\n \"input\": {\n \"session_id\": \"abc123-session-id\",\n \"face_image_url\": \"https://example.com/face.jpg\",\n \"text\": \"你好,欢迎来到我的频道\",\n \"voice_id\": \"girlfriend_1_cn\",\n \"voice_language\": \"zh\",\n \"audio_url\": \"https://example.com/speech.mp3\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"session_id\": \"abc123-session-id\",\n \"face_image_url\": \"https://example.com/face.jpg\",\n \"text\": \"你好,欢迎来到我的频道\",\n \"voice_id\": \"girlfriend_1_cn\",\n \"voice_language\": \"zh\",\n \"audio_url\": \"https://example.com/speech.mp3\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"session_id\": \"abc123-session-id\",\n \"face_image_url\": \"https://example.com/face.jpg\",\n \"text\": \"你好,欢迎来到我的频道\",\n \"voice_id\": \"girlfriend_1_cn\",\n \"voice_language\": \"zh\",\n \"audio_url\": \"https://example.com/speech.mp3\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "task_abc123",
"task_id": "task_abc123",
"object": "video",
"model": "kling-lip-sync",
"status": "",
"progress": 0,
"created_at": 1773812605
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Kuaishou
kling-lip-sync
Create an asynchronous lip sync video generation task. The facial movements in the source video are re-animated to match the provided speech.
Prerequisite: call the identify-face endpoint first to obtain a session_id.
Two input modes are supported:
- Text mode — provide
text,voice_id, andvoice_language. The platform converts the text to speech using the specified voice and drives the lip movements. - Audio mode — provide
audio_url. The lip movements are driven directly by the supplied audio file.
After submission, poll GET /kling/v1/videos/advanced-lip-sync/{task_id} until status is succeeded.
POST
/
kling
/
v1
/
videos
/
advanced-lip-sync
Create Lip Sync Task
curl --request POST \
--url https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"session_id": "abc123-session-id",
"face_image_url": "https://example.com/face.jpg",
"text": "你好,欢迎来到我的频道",
"voice_id": "girlfriend_1_cn",
"voice_language": "zh",
"audio_url": "https://example.com/speech.mp3"
}
}
'import requests
url = "https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync"
payload = { "input": {
"session_id": "abc123-session-id",
"face_image_url": "https://example.com/face.jpg",
"text": "你好,欢迎来到我的频道",
"voice_id": "girlfriend_1_cn",
"voice_language": "zh",
"audio_url": "https://example.com/speech.mp3"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
session_id: 'abc123-session-id',
face_image_url: 'https://example.com/face.jpg',
text: '你好,欢迎来到我的频道',
voice_id: 'girlfriend_1_cn',
voice_language: 'zh',
audio_url: 'https://example.com/speech.mp3'
}
})
};
fetch('https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'session_id' => 'abc123-session-id',
'face_image_url' => 'https://example.com/face.jpg',
'text' => '你好,欢迎来到我的频道',
'voice_id' => 'girlfriend_1_cn',
'voice_language' => 'zh',
'audio_url' => 'https://example.com/speech.mp3'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync"
payload := strings.NewReader("{\n \"input\": {\n \"session_id\": \"abc123-session-id\",\n \"face_image_url\": \"https://example.com/face.jpg\",\n \"text\": \"你好,欢迎来到我的频道\",\n \"voice_id\": \"girlfriend_1_cn\",\n \"voice_language\": \"zh\",\n \"audio_url\": \"https://example.com/speech.mp3\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"session_id\": \"abc123-session-id\",\n \"face_image_url\": \"https://example.com/face.jpg\",\n \"text\": \"你好,欢迎来到我的频道\",\n \"voice_id\": \"girlfriend_1_cn\",\n \"voice_language\": \"zh\",\n \"audio_url\": \"https://example.com/speech.mp3\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/kling/v1/videos/advanced-lip-sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"session_id\": \"abc123-session-id\",\n \"face_image_url\": \"https://example.com/face.jpg\",\n \"text\": \"你好,欢迎来到我的频道\",\n \"voice_id\": \"girlfriend_1_cn\",\n \"voice_language\": \"zh\",\n \"audio_url\": \"https://example.com/speech.mp3\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "task_abc123",
"task_id": "task_abc123",
"object": "video",
"model": "kling-lip-sync",
"status": "",
"progress": 0,
"created_at": 1773812605
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Voice ID Reference
Browse all available voice IDs with audio previews to find the right value for the
voice_id parameter.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Show child attributes
Show child attributes
Response
Lip sync task created
Task ID
Example:
"task_abc123"
Task ID (same as id)
Example:
"task_abc123"
Example:
"video"
Example:
"kling-lip-sync"
Initially empty; poll the query endpoint for updates.
Example:
""
Progress 0–100
Example:
0
Unix timestamp
Example:
1773812605
Was this page helpful?
⌘I