img_id. The voice can come from uploaded finished audio, a built-in TTS voice, or a custom TTS voice.Ai-Trace-Id for each request;img_id returned by the image upload endpoint;media_id returned by the media upload endpoint;speaker_id.image;image_url.img_id. You cannot pass an image file or image URL directly to the Image Avatar generation endpoint. The image upload endpoint supports png, webp, jpeg, and jpg files up to 20MB and within 10000px.| Field | Type | Usage Rule |
|---|---|---|
| image | binary | Use when uploading a local image file |
| image_url | string | Use when uploading through an image URL |
image or image_url, but not both. Regardless of which method you use, the next step uses only the Resp.img_id returned by the endpoint.| Voice Source | Request Fields | Processing Rule |
|---|---|---|
| Uploaded finished audio | audio_media_id | Uses the finished audio directly to drive lip movement; TTS is not performed |
| TTS | lip_sync_tts_content + lip_sync_tts_speaker_id | Uses the selected built-in or custom voice to read the script and drive lip movement |
audio_media_id or lip_sync_tts_content, but not both;lip_sync_tts_content must contain 30–200 characters;lip_sync_tts_speaker_id can be a valid built-in voice ID, a custom voice ID, or auto to use the default voice;| Field | Type | Required | Description |
|---|---|---|---|
| API-KEY | string | Yes | API authentication |
| Ai-Trace-Id | string | Yes | Use a unique value for each request |
| Content-Type | string | Yes | Must be application/json |
| Field | Type | Requirement | Description |
|---|---|---|---|
| img_id | int64 | Required | Image resource ID returned by the image upload endpoint; only one image is supported |
| quality | string | Required | Currently supports 360p, 540p, 720p, and 1080p |
| prompt | string | Optional | Describes the person's movement, pose, expression, or other visual requirements |
| audio_media_id | int64 | Conditionally required | Uploaded finished-audio media_id; use either this field or lip_sync_tts_content |
| lip_sync_tts_content | string | Conditionally required | TTS script containing 30–200 characters; use either this field or audio_media_id |
| lip_sync_tts_speaker_id | string | Conditionally required | Built-in or custom voice ID used for TTS; auto is also supported |
| webhook_id | string | Optional | Uses a webhook already configured on the platform |
{
"img_id": 1233333,
"quality": "720p",
"prompt": "The person keeps both hands folded and remains still.",
"audio_media_id": 23424143
}{
"img_id": 1233333,
"quality": "720p",
"prompt": "The person keeps both hands folded and remains still.",
"lip_sync_tts_content": "Good evening, everyone.",
"lip_sync_tts_speaker_id": "auto"
}{
"img_id": 1233333,
"quality": "720p",
"prompt": "The person keeps both hands folded and remains still.",
"lip_sync_tts_content": "Good evening, everyone.",
"lip_sync_tts_speaker_id": "speaker_custom_123"
}audio_media_id in this case. The voice sample is used only when creating the custom voice. The Image Avatar task references only the speaker_id returned by the custom voice creation endpoint or TTS voice list endpoint.| Field | Type | Description |
|---|---|---|
| ErrCode | int | 0 indicates success |
| ErrMsg | string | Error message |
| Resp.video_id | int64 | Generation task ID |
| Resp.credits | int | Credits consumed or estimated for this task |
| status | Meaning | Action |
|---|---|---|
| 1 | Generation succeeded | Use Resp.url to access the video |
| 5 | Generation in progress | Continue polling |
| 7 | Content moderation failed | Stop polling |
| 8 | Generation failed | Stop polling |
Resp.media_id. The sample audio must be shorter than 30 seconds.POST /openapi/v2/video/tts_speaker, pass the sample media_id as audio_media_id, and obtain Resp.speaker_id.GET /openapi/v2/video/lip_sync/tts_list. Pass speaker_type=custom to query the current user's custom voices, and identify a voice by the returned speaker_id and name.speaker_id to lip_sync_tts_speaker_id together with lip_sync_tts_content.DELETE /openapi/v2/video/tts_speaker/{speaker_id}. This endpoint does not have a request body.| Stage | Field Obtained | Used In the Next Step |
|---|---|---|
| Upload a voice sample | Resp.media_id | audio_media_id in the custom voice creation request |
| Create a custom voice | Resp.speaker_id | lip_sync_tts_speaker_id in the Image Avatar request |
| Query the voice list | Resp.data[].speaker_id | Reselect or confirm an available custom voice |
| Delete a custom voice | speaker_id | Path parameter of the DELETE endpoint |
ErrCode=0 and that you obtained Resp.speaker_id;speaker_type=custom and confirm that the voice belongs to the current API account;speaker_id unchanged to lip_sync_tts_speaker_id, together with lip_sync_tts_content;media_id used for voice creation to the Image Avatar TTS request.img_id returned by the image upload endpoint, not an image file or image URL;img_id and quality are required;audio_media_id;lip_sync_tts_content and lip_sync_tts_speaker_id;360p, 540p, 720p, and 1080p;