Prerequisites
An image of a person (PNG or JPEG) — accessible via a public URL or uploaded as an asset
A voice_id for the voice you want. Use GET /v3/voices to browse options.
Step 1 — Generate the video
Use POST /v3/videos with type: "image" and an image object instead of avatar_id:
From image URL
From uploaded asset
First upload via POST /v3/assets, then reference the returned asset_id:
type: "image" and type: "avatar" are mutually exclusive — use exactly one.
Step 2 — Poll for completion
Video generation is asynchronous. Poll GET /v3/videos/{video_id} until the status reaches completed:
| Status | Meaning |
|---|
pending | Queued for processing |
processing | Video is being generated |
completed | Ready — video_url is available |
failed | Something went wrong |
Full example
Using audio instead of a script
You can lip-sync to a custom audio file instead of generating speech from text. Pass audio_url or audio_asset_id instead of script + voice_id:
script and audio_url/audio_asset_id are mutually exclusive. If you provide a script, you must also provide a voice_id.
Optional parameters
| Parameter | Type | Description |
|---|
title | string | Display name in the HeyGen dashboard |
resolution | string | 4k, 1080p (recommended), or 720p |
aspect_ratio | string | auto (recommended — matches the source image, falling back to 16:9), 16:9, 9:16, 4:5, 5:4, or 1:1 |
remove_background | boolean | Remove the image background from the video |
background | object | Set a solid color or image background |
voice_settings | object | Adjust speed (0.5–1.5), pitch (-50 to +50), locale |
callback_url | string | Webhook URL for completion notification |
callback_id | string | Your own ID echoed back in the webhook payload |
Image-to-video vs. Photo Avatar
| Criteria | Image-to-Video | Photo Avatar |
|---|
| Setup | None — use type: "image" and go | Requires POST /v3/avatars first |
| Reusability | One-off per request | Reusable across many videos via avatar_id |
| Motion prompt | Not supported | Supported |
| Expressiveness | Not supported | high / medium / low |
| Best for | Quick tests, one-off content | Recurring brand content |
If you plan to generate multiple videos with the same person, create a Photo Avatar once and reuse its avatar_id. This saves processing time and unlocks motion and expressiveness controls.