Lip sync video
December 6, 2024 (May 16, 2025)
Table of contents
-
This endpoint uses PixVerse model
v4. -
Lip sync a video generated by PixVerse, retrieve the
video_idof the desired video using GET /videos. -
Upload the video using POST /files and use
pathto specify the video you want to lip sync. -
Upload the audio track using POST /files and use
pathto specify the audio you want to use for lip sync.
https://api.useapi.net/v2/pixverse/videos/lipsync
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API tokenis required, see Setup useapi.net for details.
Request Body
{
"video_id": "Optional video_id",
"audio_path": "Optional audio track path",
"prompt": "Optional text prompt",
"speaker_id": 12345,
"replyUrl": "Place your call back URL here",
"replyRef": "Place your reference id here",
"maxJobs": 3
}
-
emailis optional, if not specified API will use account specified byvideo_id(if provided), otherwise randomly select account from available accounts. -
video_idis optional, retrieve thevideo_idof the desired video using GET /videos. -
video_pathis optional, upload the video using POST /files and usepathto specify the video you want to lip sync. -
audio_pathis optional, upload the audio track using POST /files and usepathto specify the audio you want to use for lip sync. Maximum length of the audio track should not exceed 60 seconds. Generation will fail if you attempt to provide a sound clip longer than that. -
promptis optional, provide text you want to use for lip sync. Maximum length 200 characters. -
speaker_idis optional, to retrievespeaker_idsee GET /videos/voices. -
original_sound_switchis optional, set totrueif you want to keep the original soundtrack of the video and extend it with the provided sound clip or generated audio. -
off_peak_modeis optional. Set totrueto generate videos during low-demand periods with up to 50% credit savings. Results are usually delivered within 24 hours. Off-Peak Mode generations are not tracked by the scheduler and are not counted towards the number of currently executed jobs. The replyUrl webhook will also be ignored. You must use GET videos to retrieve the generated results.
Supported values:false(default),true. -
replyUrlis optional, if not provided value from useapi.net account will be used.
Place here your callback URL. API will call the providedreplyUrlonce PixVerse video completed or failed.
Maximum length 1024 characters.
We recommend using sites like webhook.site to test callback URL functionality. -
replyRefis optional, place here your reference id which will be stored and returned along with this PixVerse video response / result.
Maximum length 1024 characters. -
maxJobsis optional, if not specified value from selected accounts/email will be used.
Valid range: 1…8
It should not exceed the number of concurrent generations supported by your account subscription plan.
Responses
-
Use the returned
video_idto retrieve video status and results using GET /videos. Locate the video in the response array and check if the fieldvideo_status_finalistrueorvideo_status_nameisCOMPLETED. The fieldurlwill contain the generated video link.If you specify the optional parameter
replyUrl, the API will call the providedreplyUrlwith video progress updates until the video is complete or fails.{ "video_id": "user:<userid>-pixverse:<email>-video:<number>" } -
{ "error": "<Error message>" } -
{ "error": "Unauthorized" } -
Insufficient credits. All Credits have been used up. Please upgrade your membership or purchase credits.
{ "error": "All Credits have been used up. Please upgrade your membership or purchase credits." } -
Moderated message.
{ "error": "Your prompt has triggered our AI moderator, please re-enter your prompt" } -
Wait in a loop for at least 10..30 seconds and retry again.
There are two possible cases for API response 429:
- API query is full and can not accept new videos/lipsync requests. Size of query defined by
maxJobsoptional parameter.{ "error": "Account <email> is busy executing <maxJobs> tasks." "All configured accounts are running at maximum capacity." } - The API received an HTTP response status 429 from PixVerse. Please refer to your subscription plan for the maximum allowed tasks in the queue.
{ "error": "Reached the limit for concurrent generations." }
- API query is full and can not accept new videos/lipsync requests. Size of query defined by
-
596 Pending mod message
Your PixVerse.ai account has a pending error. Most likely, you changed your account password or your PixVerse.ai account was placed on hold. Once the issue is resolved, update your account to clear the error by executing POST accounts/email before making any new API calls.
{ "error": "Your PixVerse account has pending error." "Please address this issue at https://useapi.net/docs/api-pixverse-v2/post-pixverse-accounts-email before making any new API calls." }
Model
{ // TypeScript, all fields are optional
video_id: string
error: string
}
Examples
-
curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -X POST "https://api.useapi.net/v2/pixverse/videos/lipsync" \ -d '{"audio_path": "…", "video_id": "…"}' -
const audio_path = "audio_path"; const video_id = "video_id"; const apiUrl = `https://api.useapi.net/v2/pixverse/videos/lipsync`; const token = "API token"; const data = { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' } }; data.body = JSON.stringify({ audio_path, video_id }); const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result}); -
import requests audio_path = "audio_path" video_id = "video_id" apiUrl = f"https://api.useapi.net/v2/pixverse/videos/lipsync" token = "API token" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } body = { "audio_path": f"{audio_path}", "video_id": f"{video_id}" } response = requests.post(apiUrl, headers=headers, json=body) print(response, response.json())