API reference · HeyGen

heygen/avatar5/digital-twin

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

VIDEOAsyncOpen model
Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/run
Model IDheygen/avatar5/digital-twin
01

Input Schema

12 parameters · 1 required · 11 optional

ParameterTypeRequiredDescription
promptstringRequiredText the avatar will speak. Required when ``audio_url`` is not provided.
fitstringOptionalHow the avatar fits within the output frame. 'contain' keeps the full avatar in view (may letterbox); 'cover' fills the frame (may crop). · Options: contain, cover · Default: "cover"
containcover
audiostringOptionalHTTP(S) URL of an audio file for the avatar to lip-sync to. When provided, the avatar uses this audio instead of text-to-speech and ``prompt``/``voice`` are ignored.
voicestringOptionalName of the text-to-speech voice to use for the avatar when ``audio_url`` is not provided. · Options: Warm Pro Narrator, Chill Brian, Ivy, John Doe, Monika Sogam, Hope , Archer , Brittney, Patrick, David Castlemore, Michael C, Adam Stone , Juniper, Cassidy , Jessica Anne Bogart, Arabella, Andrew, Spuds Oxley , Grace Elder, Helen, Canyon Rivers, Derya - Lifelike - Excited 🤩, Mellow Marcus, Jack Sterling - Broadcaster 🎙️, Brenda - UGC - 1.mp4, Reid, Reagan, Terry, Jenny, Radio Rick, Denise, Tim in car - Excited 🤩, Iskander, Thompson, Delicate Daisy - Excited 🤩, Kingston, George UGC 1, Bold Blake, Jane, Expressive Evan, Marianne - IA, Aaron, Modern Recipe Host - Voice 1, Willow, Cute Chloe - Friendly 😊, Rafael, June - Lifelike, Crisp Chloe, Slick Simon, Nassim - Informative, Baritone Ben, Maxwell, Ellie Faye - Excited 🤩, Milani, Feisty Fiona - Excited 🤩, Professor Dean, Rose - UGC - 1.mp4, Shona, Hudson Wilder, Ann - IA, Alastair Kensington, Oxley, Christina, Andrew Rizz , Peyton, Gerardo - Outdoor, Chloe - Lifelike, Stephanie, Anthony - IA, Signal - Voice 1, Luca, Lisa - Voice 1, T.W.Tucker, Jack Sullivan - Serious 😐, Winter, Mireia - Lifelike, Georgia, Stella, Masha - Lifelike, Charming Charles - Friendly 😊, Serenity, Annie - Excited, Ralph, Bethany, Dominic, Mason Finn, Leena, Veteran Victor, Tamara, Nik Public, Calm Chloe, Sevik, Reilly, Raul, Imposing Ian, Relaxed Ray, Dexter - Professional, Relaxed Rick, Edwin, Rupert Blackwood, Ginny, Hope · Default: "Warm Pro Narrator"
Warm Pro NarratorChill BrianIvyJohn DoeMonika SogamHope Archer BrittneyPatrickDavid CastlemoreMichael CAdam Stone JuniperCassidy Jessica Anne BogartArabellaAndrewSpuds Oxley Grace ElderHelenCanyon RiversDerya - Lifelike - Excited 🤩Mellow MarcusJack Sterling - Broadcaster 🎙️Brenda - UGC - 1.mp4ReidReaganTerryJennyRadio RickDeniseTim in car - Excited 🤩IskanderThompsonDelicate Daisy - Excited 🤩KingstonGeorge UGC 1Bold BlakeJaneExpressive EvanMarianne - IAAaronModern Recipe Host - Voice 1WillowCute Chloe - Friendly 😊RafaelJune - LifelikeCrisp ChloeSlick SimonNassim - InformativeBaritone BenMaxwellEllie Faye - Excited 🤩MilaniFeisty Fiona - Excited 🤩Professor DeanRose - UGC - 1.mp4ShonaHudson WilderAnn - IAAlastair KensingtonOxleyChristinaAndrew Rizz PeytonGerardo - OutdoorChloe - LifelikeStephanieAnthony - IASignal - Voice 1LucaLisa - Voice 1T.W.TuckerJack Sullivan - Serious 😐WinterMireia - LifelikeGeorgiaStellaMasha - LifelikeCharming Charles - Friendly 😊SerenityAnnie - ExcitedRalphBethanyDominicMason FinnLeenaVeteran VictorTamaraNik PublicCalm ChloeSevikReillyRaulImposing IanRelaxed RayDexter - ProfessionalRelaxed RickEdwinRupert BlackwoodGinnyHope
avatarstringOptionalName of the Avatar V-eligible avatar to use. · Default: "Abigail Sofa Front"
captionbooleanOptionalGenerate a sidecar SRT caption file alongside the video. · Default: false
watermarkstringOptionalOptional watermark image to overlay on the output video.
backgroundstringOptionalOptional background to composite behind the avatar. Ignored when ``output_format='webm'`` (webm output is transparent).
resolutionstringOptionalOutput resolution preset. · Options: 720p, 1080p, 4k · Default: "720p"
720p1080p4k
aspect_ratiostringOptionalThe 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_formatstringOptionalOutput container format. 'webm' produces a transparent video (automatically removes the background) and ignores the ``background`` field. · Options: mp4, webm · Default: "mp4"
mp4webm
remove_backgroundbooleanOptionalRemove the avatar's background. Requires a matting-enabled avatar. · Default: false
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

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/avatar5/digital-twin",
  "fit": "cover",
  "voice": "Warm Pro Narrator",
  "avatar": "Abigail Office Front",
  "prompt": "Hello and welcome to this demonstration of HeyGen Avatar V.",
  "caption": false,
  "resolution": "720p",
  "output_format": "mp4",
  "remove_background": false
}'

# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
  -H "Authorization: Bearer YOUR_API_KEY"