https://app-api.pixverse.ai/openapi/v2/video/lip_sync/generateGET https://app-api.pixverse.ai/openapi/v2/video/lip_sync/tts_listPOST https://app-api.pixverse.ai/openapi/v2/video/tts_speakerDELETE https://app-api.pixverse.ai/openapi/v2/video/tts_speaker/{speaker_id}To use a custom voice, upload a sample audio file first, then call the custom voice creation endpoint to obtain a speaker_id. Refer to the latest custom voice endpoint documentation for sample-audio limits.
{
"ErrCode": 0,
"ErrMsg": "success",
"Resp": {
"media_id": 0,
"media_type": "video",
"url": "https://media.pixverse.ai/111111.mp4"
}
}{
"ErrCode": 0,
"ErrMsg": "success",
"Resp": {
"media_id": 0,
"media_type": "audio",
"url": "https://media.pixverse.ai/111111.mp3"
}
}| Parameter Name | Required | Type | Description |
|---|---|---|---|
| page_num | optional | int | Page number |
| page_size | optional | int | Number of items per page |
| speaker_type | optional | string | system: built-in voices; custom: custom voices; all: all voices. Default: all |
speaker_id and name. Pass the selected speaker_id to lip_sync_tts_speaker_id in the generation request.Resp.media_id.media_id as audio_media_id to the custom voice creation endpoint:| Parameter Name | Required | Type | Description |
|---|---|---|---|
| name | required | string | Custom voice name |
| audio_media_id | required | int | Sample audio media_id returned by the upload API |
{
"ErrCode": 0,
"ErrMsg": "success",
"Resp": {
"speaker_id": "your-custom-speaker-id"
}
}In the custom voice creation endpoint, audio_media_ididentifies the sample audio used for voice cloning. In the Lipsync generation endpoint,audio_media_ididentifies the finished audio used for lip synchronization. The field name is the same, but its purpose depends on the endpoint.
{
"source_video_id": 123456,
"audio_media_id": 234567
}{
"source_video_id": 123456,
"lip_sync_tts_speaker_id": "auto-or-custom-speaker-id",
"lip_sync_tts_content": "hello this is harry, where are you from?"
}{
"video_media_id": 123456,
"audio_media_id": 234567
}{
"video_media_id": 123456,
"lip_sync_tts_speaker_id": "auto-or-custom-speaker-id",
"lip_sync_tts_content": "hello this is harry, where are you from?"
}{
"ErrCode": 0,
"ErrMsg": "success",
"Resp": {
"video_id": 0,
"credits": 0
}
} {
"ErrCode": 0,
"ErrMsg": "string",
"Resp": {
"create_time": "string",
"id": 0,
"modify_time": "string",
"negative_prompt": "string",
"outputHeight": 0,
"outputWidth": 0,
"prompt": "string",
"resolution_ratio": 0,
"seed": 0,
"size": 0,
"status": 5,
"style": "string",
"url": "string"
}
} {
"ErrCode": 0,
"ErrMsg": "string",
"Resp": {
"create_time": "string",
"id": 0,
"modify_time": "string",
"negative_prompt": "string",
"outputHeight": 0,
"outputWidth": 0,
"prompt": "string",
"resolution_ratio": 0,
"seed": 0,
"size": 0,
"status": 1,
"style": "string",
"url": "string"
}
}speaker_id returned by the custom voice creation endpoint in the request path:| Parameter Name | Required | Type | Description |
|---|---|---|---|
| speaker_id | required | string | Custom voice ID returned by the custom voice creation endpoint; pass it as a path parameter |
{
"ErrCode": 0,
"ErrMsg": "Success",
"Resp": {
"speaker_id": "your-custom-speaker-id",
"deleted": true
}
}speaker_id, and pass that exact value to lip_sync_tts_speaker_id.ErrCode and ErrMsg; this guide does not assume unpublished custom error codes.| parameter | type | required | description |
|---|---|---|---|
| lip_sync_tts_switch | boolean | optional | true, false Set to true if you want to enable this feature. Default is false. |
| lip_sync_tts_content | string | optional | TTS script content; refer to the corresponding video generation API for the length limit. |
| lip_sync_tts_speaker_id | string | optional | ID from Get Speech TTS list; you can use a built-in voice ID or the speaker_id returned by the custom voice creation endpoint. |
lip_sync_switch will be billed based on the generated video length.video_duration × 4 credits (4credits from speech biiling )