Developer Docs/AI Avatar Video API

AI Avatar Video API

Build AI Avatar Video integrations with A2E. Review authentication, request parameters, task creation, status, and result endpoints.

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/generate

Generate AI video with avatar

Request Parameters

NameTypeRequiredDescription
titlestringNoVideo title (optional, max 40 characters)
audioSrcstringNoAudio source URL (required if custom_voice not provided)
custom_voicestringNoCustom voice audio URL (required if audioSrc not provided)
anchor_idstringYesAvatar/anchor ID (MongoDB ObjectId)
anchor_typenumberYesAvatar type (0 for system avatar, 1 for custom avatar)
anchor_background_imgstringNoOriginal avatar background image URL. Required for background replacement if the avatar record does not already have background_img or background_color.
anchor_background_colorstringNoOriginal avatar background color in RGBA format. Required for background replacement if the avatar record does not already have background_img or background_color.
back_idstringNoSystem background template ID (MongoDB ObjectId). Mutually exclusive with custom_back_id; sending both returns error 30005.
face_swap_idstringNoFace swap template ID (MongoDB ObjectId)
custom_back_idstringNoCustom background ID returned by /api/v1/custom_back/add (MongoDB ObjectId). Mutually exclusive with back_id; sending both returns error 30005.
colorstringNoColor setting in RGBA format
wl_modelstringNoWatermark/logo model setting
isSkipRsbooleanNoSkip resolution scaling
web_bg_widthnumberNoOutput canvas/background width. Required when using back_id, custom_back_id, or color.
web_bg_heightnumberNoOutput canvas/background height. Required when using back_id, custom_back_id, or color.
web_people_widthnumberNoAvatar width in output layout. Required when using back_id, custom_back_id, or color.
web_people_heightnumberNoAvatar height in output layout. Required when using back_id, custom_back_id, or color.
web_people_xnumberNoAvatar X position in web layout
web_people_ynumberNoAvatar Y position in web layout
web_dist_bg_widthnumberNoDistributed background width
web_dist_bg_heightnumberNoDistributed background height
web_dist_bg_xnumberNoDistributed background X position
web_dist_bg_ynumberNoDistributed background Y position
resolutionnumberNoVideo resolution (height in pixels)
msgstringNoAdditional message or notes
erode_factornumberNoErosion factor for image processing
isSkipGpbooleanNoSkip green screen processing
isCaptionEnabledbooleanNoEnable captions/subtitles
gp_modelobjectNoGreen screen processing model settings
isToPublicPoolbooleanNoAdd to public pool for sharing
lip_modelstringNoLip sync model selection
captionAlignobjectNoCaption alignment and styling settings
webhook_urlstringNoHTTPS 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_tokenstringNoOptional 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/list

List available avatars

POST/api/v1/video/generate

Generate AI video with avatar

GET/api/v1/video/detail

Get 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