Skip to main content
Free usage: avatar videos created through CLI OAuth (heygen auth login --oauth) draw from your free monthly quota — no pay-as-you-go charge. See Free usage for agents.

Prerequisites

A Digital Twin avatar_id (type: digital_twin). Use GET /v3/avatars/looks?avatar_type=digital_twin to find yours.
A voice_id for the voice you want. Use GET /v3/voices to browse available voices.

Step 1 — Find your Digital Twin

List your private Digital Twin looks to get the avatar_id:
From the response, copy the id field of the look you want. This is your avatar_id.

Step 2 — Choose a rendering engine

HeyGen v3 supports three rendering engines for Digital Twins. You select the engine via the engine object in your video creation request.
EngineKeyDefault?Quality
Avatar IVavatar_ivYes — used when engine is omittedStandard, widely supported
Avatar Vavatar_vNo — must be explicitly requestedHigher quality, cross-reference-driven animation
Avatar IIIavatar_iiiNo — must be explicitly requestedDedicated photo-to-video pipeline
Before requesting Avatar V, check the supported_api_engines array on the avatar look via GET /v3/avatars/looks/{look_id} — if avatar_v is not listed, the request will be rejected. Avatar III does not appear in supported_api_engines and accepts any avatar look. See Models for full details on each engine.

Step 3 — Create the video

Send a POST request to /v3/videos with type: "avatar", your Digital Twin ID, a script, and a voice.

Using Avatar IV (default)

Omit the engine field or pass {"type": "avatar_iv"} — Avatar IV is the default:

Using Avatar V (higher quality)

Pass {"type": "avatar_v"} in the engine field to request cross-reference-driven animation:
motion_prompt is supported on both Avatar IV and Avatar V — pass a natural-language prompt to control body motion and hand gestures.expressiveness remains an Avatar IV-only parameter. Do not include it when using Avatar V — it will cause a validation error.

Step 4 — Poll for completion

Video generation is asynchronous. Poll GET /v3/videos/{video_id} until status is completed:

Status values

StatusMeaning
pendingQueued for processing
processingVideo is being generated
completedReady — video_url is available
failedSomething went wrong — check failure_message
Once completed, the response includes a video_url with a presigned download link.

Full example

Optional parameters

ParameterTypeEngineDescription
titlestringBothDisplay name in the HeyGen dashboard
resolutionstringBoth4k, 1080p (recommended), or 720p
aspect_ratiostringBothauto (recommended — matches the source, falling back to 16:9), 16:9, 9:16, 4:5, 5:4, or 1:1
engineobject{"type": "avatar_iv"}, {"type": "avatar_v"}, or {"type": "avatar_iii"}. Defaults to Avatar IV when omitted
remove_backgroundbooleanBothRemoves the avatar background (supported by default on new digital twins)
backgroundobjectBothSet a solid color or image background
voice_settingsobjectBothAdjust speed (0.5–1.5), pitch (-50 to +50), and locale
motion_promptstringBothNatural-language prompt controlling avatar body motion and hand gestures
expressivenessstringIV onlyhigh, medium, or low. Defaults to low
output_formatstringBothmp4 (default) or webm (transparent background / alpha channel)
callback_urlstringBothWebhook URL — receive a POST when the video is ready

Using webhooks instead of polling

Instead of polling, pass a callback_url when creating the video. HeyGen will send a POST request to that URL when the video completes or fails.
Register a webhook endpoint via POST /v3/webhooks/endpoints and subscribe to avatar_video.success and avatar_video.fail events for production use.