Overview
Submit a script or audio file to generate an avatar presentation video. The digital avatar lip-syncs to your content and speaks on your behalf.
Primary Endpoint
POST
/api/v1/video/generateGenerate AI video with avatar
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| title | string | No | Video title (optional, max 40 characters) |
| audioSrc | string | No | Audio source URL (required if custom_voice not provided) |
| custom_voice | string | No | Custom voice audio URL (required if audioSrc not provided) |
| anchor_id | string | Yes | Avatar/anchor ID (MongoDB ObjectId) |
| anchor_type | number | Yes | Avatar type (0 for system avatar, 1 for custom avatar) |
| anchor_background_img | string | No | Original avatar background image URL. Required for background replacement if the avatar record does not already have background_img or background_color. |
| anchor_background_color | string | No | Original avatar background color in RGBA format. Required for background replacement if the avatar record does not already have background_img or background_color. |
| back_id | string | No | System background template ID (MongoDB ObjectId). Mutually exclusive with custom_back_id; sending both returns error 30005. |
| face_swap_id | string | No | Face swap template ID (MongoDB ObjectId) |
| custom_back_id | string | No | Custom background ID returned by /api/v1/custom_back/add (MongoDB ObjectId). Mutually exclusive with back_id; sending both returns error 30005. |
| color | string | No | Color setting in RGBA format |
| wl_model | string | No | Watermark/logo model setting |
| isSkipRs | boolean | No | Skip resolution scaling |
| web_bg_width | number | No | Output canvas/background width. Required when using back_id, custom_back_id, or color. |
| web_bg_height | number | No | Output canvas/background height. Required when using back_id, custom_back_id, or color. |
| web_people_width | number | No | Avatar width in output layout. Required when using back_id, custom_back_id, or color. |
| web_people_height | number | No | Avatar height in output layout. Required when using back_id, custom_back_id, or color. |
| web_people_x | number | No | Avatar X position in web layout |
| web_people_y | number | No | Avatar Y position in web layout |
| web_dist_bg_width | number | No | Distributed background width |
| web_dist_bg_height | number | No | Distributed background height |
| web_dist_bg_x | number | No | Distributed background X position |
| web_dist_bg_y | number | No | Distributed background Y position |
| resolution | number | No | Video resolution (height in pixels) |
| msg | string | No | Additional message or notes |
| erode_factor | number | No | Erosion factor for image processing |
| isSkipGp | boolean | No | Skip green screen processing |
| isCaptionEnabled | boolean | No | Enable captions/subtitles |
| gp_model | object | No | Green screen processing model settings |
| isToPublicPool | boolean | No | Add to public pool for sharing |
| lip_model | string | No | Lip sync model selection |
| captionAlign | object | No | Caption alignment and styling settings |
| webhook_url | string | No | HTTPS URL to receive task.completed / task.failed notifications. Best-effort delivery, single attempt, no retries; clients should treat the detail API as the source of truth. |
| webhook_token | string | No | Optional plaintext token returned in the X-A2e-Webhook-Token header so receivers can verify the request originated from a2e. |
Request Example
curl -X POST "https://www.a2e.com.cn/api/v1/video/generate" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "My AI Video",
"audioSrc": "https://example.com/audio.mp3",
"custom_voice": "https://example.com/custom_voice.wav",
"anchor_id": "507f1f77bcf86cd799439011",
"anchor_type": 0,
"anchor_background_img": "https://example.com/original-avatar-background.jpg",
"anchor_background_color": "rgba(255,255,255,1)",
"back_id": "507f1f77bcf86cd799439012",
"face_swap_id": "507f1f77bcf86cd799439013",
"custom_back_id": "507f1f77bcf86cd799439014",
"color": "rgba(0,0,0,1)",
"wl_model": "default"
}'Related Endpoints
POST
/api/v1/anchor/listList available avatars
POST
/api/v1/video/generateGenerate AI video with avatar
GET
/api/v1/video/detailGet record details
Responses
200
Video generation started successfully
400
Bad Request - Invalid parameters or missing required audio source
401
Unauthorized - Invalid or missing bearer token