heygen/heygen-avatar4/digital-twin
Heygen Avatar4 Digital Twin is HeyGen's text-to-video AI model. Turn written scripts and prompts into professional-quality video clips with realistic motion, lighting, and scene composition.
Example output — click Run to generate your own
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
https://api.sandbase.ai/v1/runheygen/heygen-avatar4/digital-twinInput Schema
4 parameters · 0 required · 4 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
audio | string | Optional | URL of an audio file for the avatar to lip-sync to. When provided, the avatar uses this audio instead of text-to-speech. |
voice | string | Optional | The voice ID to use for the avatar. |
avatar_id | string | Optional | The character/avatar ID to use. |
aspect_ratio | string | Optional | The aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16 21:916:93:24:35:41:14:53:42:39:16 |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "heygen/heygen-avatar4/digital-twin",
"prompt": "a beautiful sunset over mountains"
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"API README
HeyGen Avatar 4 Digital Twin
heygen/heygen-avatar4/digital-twin creates a talking digital-human video whose facial movement, timing, and expression follow supplied speech or creative direction. Avatar 4 Digital Twin emphasizes lifelike portrait motion, expressive gestures, and reliable identity across repeated presenter videos. This combination makes the model a practical choice when the creative outcome depends on those qualities rather than on a generic media conversion.
For production work with heygen/heygen-avatar4/digital-twin, the workflow suits explainers, training, localization, personalized outreach, and presenter-led content where a reusable human presence needs to deliver changing material. The result is most reliable when the source material and creative brief clearly describe the intended subject, progression, visual or sonic character, and the qualities that must remain unchanged.
Highlights
Speech-driven facial animation aligns mouth shapes, expression, and timing with the performance.
Avatar 4 expression produces lifelike facial movement and presenter gestures.
Presenter consistency supports repeated videos without reshooting the same person.
Expressive performance turns scripted material into an engaging on-camera delivery.
Pricing
| Generated or processed duration | Price |
|---|---|
| Per second | $0.100 |
When to Use
| ✅ Good fit | ❌ Consider alternatives |
|---|---|
| The model's named workflow matches the source material and intended output | A different input modality or model route is required |
| A managed asynchronous result is suitable for the production pipeline | A synchronous, interactive editor is essential |
| The documented controls cover the required duration, framing, or format | The project needs controls outside this endpoint's schema |
| Creative iteration benefits from a repeatable request structure | Exact deterministic pixels, frames, geometry, or samples are mandatory |
| A finished downloadable media asset is the desired deliverable | Editable source layers or a native project file are required |
Prompt Guide
For audio transformation, state the intended result first, then add the subject or source treatment, progression, style, and delivery constraints. Keep one creative variable per phrase, use the documented field names for controls, and change one setting at a time when comparing results.
{
"aspect_ratio": "21:9",
"audio": "https://example.com/source.wav"
}
Technical Specs
| Spec | Value |
|---|---|
| Model ID | heygen/heygen-avatar4/digital-twin |
| Inputs | aspect_ratio, audio, avatar_id, voice |
| Required inputs | None |
| Output fields | content_type, url |
| Execution | Async (submit, then poll for result) |
| Aspect Ratio | 21:9 / 16:9 / 3:2 / 4:3 / 5:4 / 1:1 / 4:5 / 3:4 / 2:3 / 9:16 |

