POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/heygen-avatar-v"; const data = { "avatar": "Abigail Sofa Front", "prompt": "Hello! This is an Avatar V demo on Segmind.", "voice": "Aaron", "resolution": "1080p", "aspect_ratio": "16:9", "fit": "cover", "caption": false, "output_format": "mp4", "remove_background": false }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


avatarenum:str ( default: Abigail Sofa Front )

Choose a ready-made HeyGen Digital Twin avatar (24 options). Use defaults for product demos or pitches.

Allowed values:


promptstr ( default: 1 )

Text the avatar will speak; mutually exclusive with audio_url. Keep clips under 60s for fastest renders.


voiceenum:str ( default: Aaron )

Text-to-speech voice paired with prompt. Match voice tone to use case โ€” Aaron and Daniel suit explainers.

Allowed values:


audio_urlstr ( default: 1 )

Public MP3/WAV URL to lip-sync to instead of prompt+voice. Use for music videos or pre-recorded narration.


avatar_idstr ( default: 1 )

Raw HeyGen avatar ID; overrides 'avatar'. Pass a Digital Twin ID from heygen-avatar-v-create for custom faces.


voice_idstr ( default: 1 )

Raw HeyGen voice ID; overrides 'voice'. Use for cloned or premium voices beyond the dropdown list.


video_urlstr ( default: 1 ) Affects Pricing

Reference footage (โ‰ฅ15s, video/mp4) to train a Digital Twin in one call. Adds $1.25 one-time training fee.


resolutionenum:str ( default: 1080p )

Output resolution: 720p (cheap drafts), 1080p (default โ€” best quality/cost), 4k (premium production).

Allowed values:


aspect_ratioenum:str ( default: 16:9 )

Output aspect ratio. Use 16:9 for landing pages, 9:16 for shorts/reels, 1:1 for social feed.

Allowed values:


fitenum:str ( default: cover )

How the avatar fits the frame. 'cover' fills the frame (recommended); 'contain' preserves entire framing.

Allowed values:


backgroundstr ( default: 1 )

Optional background โ€” hex color (#FFFFFF) or image URL. Leave blank for the avatar's native scene.


captionbool ( default: 1 )

Generate SRT captions; response becomes JSON with video_url + caption_url. Enable for accessibility or social posts.


output_formatenum:str ( default: mp4 )

Output container โ€” mp4 for standard playback, webm to preserve transparent background channel.

Allowed values:


remove_backgroundbool ( default: 1 )

Strip background for compositing into other scenes. Pair with output_format=webm for alpha channel.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

HeyGen Avatar V - Talking Avatar Video Generation

What is HeyGen Avatar V?

HeyGen Avatar V is HeyGen's latest talking-avatar engine, served on Segmind as a synchronous video API. Built on a diffusion-style audio-to-expression model, it generates studio-quality talking-head clips from text or audio in roughly 60โ€“120 seconds. Unlike older avatar models that simply sync lips to phonemes, Avatar V interprets tone, rhythm, and emotion โ€” producing natural micro-expressions, head tilts, and pauses that match the cadence of the script. Pair the API with heygen-avatar-v-create to train a Digital Twin from a 15-second reference video and use your own likeness.

Key Features

  • 24 production-ready avatars in business, casual, fitness, and medical scenes
  • 20 text-to-speech voices plus support for raw HeyGen voice_id overrides
  • Drive lip sync from prompt text or any public audio_url
  • 720p, 1080p, and 4K outputs at 16:9, 9:16, 4:5, 5:4, 1:1, or auto
  • Optional SRT caption generation and background removal (webm alpha channel)
  • One-shot Digital Twin creation by passing a video_url reference clip

Best Use Cases

Confirmed in testing: 1080p 16:9 clips render with natural lip sync, head and eye movement, and clean ambient lighting in under 90 seconds end-to-end. The model excels at explainer videos, sales outreach, product demos, training content, and personalized marketing โ€” anywhere you'd otherwise hire on-camera talent. The Digital Twin path makes it practical to scale founder-led video, internal comms, and social-first ads without a studio.

Prompt Tips and Output Quality

Keep the spoken prompt natural and conversational โ€” Avatar V mirrors vocal rhythm, so written-for-the-eye copy reads stiffly. For best results, pair a matched voice with the avatar's vibe (e.g., Aaron for executives, Mia Starset for upbeat creators). Use audio_url when you need exact intonation; pass cleanly recorded narration in MP3 or WAV.

FAQs

How long can the video be? Up to 180 seconds per generation. What does it cost? $0.10 per second of output โ€” roughly $0.90 for a 9-second clip. Can I use my own face? Yes โ€” train a Digital Twin via heygen-avatar-v-create and pass the returned avatar_id. Does it support 4K? Yes โ€” set resolution: "4k". Can I get a transparent background? Yes โ€” set remove_background: true and output_format: "webm". Can I generate captions? Yes โ€” set caption: true to receive an SRT file alongside the video.