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);
}
})();Choose a ready-made HeyGen Digital Twin avatar (24 options). Use defaults for product demos or pitches.
Allowed values:
Text the avatar will speak; mutually exclusive with audio_url. Keep clips under 60s for fastest renders.
Text-to-speech voice paired with prompt. Match voice tone to use case โ Aaron and Daniel suit explainers.
Allowed values:
Public MP3/WAV URL to lip-sync to instead of prompt+voice. Use for music videos or pre-recorded narration.
Raw HeyGen avatar ID; overrides 'avatar'. Pass a Digital Twin ID from heygen-avatar-v-create for custom faces.
Raw HeyGen voice ID; overrides 'voice'. Use for cloned or premium voices beyond the dropdown list.
Reference footage (โฅ15s, video/mp4) to train a Digital Twin in one call. Adds $1.25 one-time training fee.
Output resolution: 720p (cheap drafts), 1080p (default โ best quality/cost), 4k (premium production).
Allowed values:
Output aspect ratio. Use 16:9 for landing pages, 9:16 for shorts/reels, 1:1 for social feed.
Allowed values:
How the avatar fits the frame. 'cover' fills the frame (recommended); 'contain' preserves entire framing.
Allowed values:
Optional background โ hex color (#FFFFFF) or image URL. Leave blank for the avatar's native scene.
Generate SRT captions; response becomes JSON with video_url + caption_url. Enable for accessibility or social posts.
Output container โ mp4 for standard playback, webm to preserve transparent background channel.
Allowed values:
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 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.
voice_id overridesprompt text or any public audio_urlwebm alpha channel)video_url reference clipConfirmed 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.
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.
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.