POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/heygen-avatar-v-create"; const data = { "name": "My Digital Twin" }; (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


video_urlstr *

Public mp4 URL of reference footage, ≥15 seconds, Content-Type video/mp4. Use a clean, well-lit single-take recording.


namestr *

Display name for the new Digital Twin. Any string — used for organization in your HeyGen account.


avatar_group_idstr ( default: 1 )

Optional existing identity to attach this look to. Omit to create a new identity for the person.

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 Create - Digital Twin Training API

What is HeyGen Avatar V Create?

heygen-avatar-v-create is the training endpoint for HeyGen's Digital Twin avatars. Pass a short reference video and the API enrolls a new lifelike avatar that mirrors the subject's body language, expressions, and delivery style. The endpoint returns an avatar_id (and avatar_group_id) immediately; HeyGen completes training asynchronously over a few minutes, after which the avatar_id becomes usable with the heygen-avatar-v model to generate talking-head videos at scale.

Key Features

  • Synchronous API: returns avatar_id + avatar_group_id in ~3.5 seconds
  • Trains from a single ≥15-second reference clip (mp4, public URL)
  • Captures full-body motion, hand gestures, and natural micro-expressions
  • One identity supports up to 100 different "looks" via avatar_group_id
  • Optional consent_reroute_url for branded consent flows
  • Pairs directly with heygen-avatar-v for downstream video generation

Best Use Cases

Confirmed in testing: the endpoint returns an avatar_id immediately and consent_status: "skipped" when no reroute URL is provided. Training itself completes asynchronously on HeyGen's side. Use this model to scale founder-led video, internal training, personalized outreach, and influencer-style campaigns — anywhere you need a reusable digital likeness instead of repeatedly filming the same person. The Digital Twin path is also ideal for multilingual content: train once, generate in any voice.

Prompt Tips and Output Quality

The single most important parameter is video_url. Shoot the reference footage in 1080p (or higher) at 30fps, keep the subject centered, use even lighting, and record a continuous take of 2–5 minutes for best fidelity. The clip must be at least 15 seconds and served with Content-Type: video/mp4 — shorter or wrongly-typed clips fail with "Footage is too short or too long". Avoid clothing with large logos, harsh shadows, and ambient noise.

FAQs

How long until the avatar is usable? A few minutes — poll heygen-avatar-v with the returned avatar_id until generations succeed. What does it cost? $1.25 per training run. Can I add more looks to one identity? Yes — pass the existing avatar_group_id on subsequent calls. Do I need a consent video? HeyGen requires consent for production use; pass consent_reroute_url to route subjects through a branded consent page. What format must the reference be? Public URL serving mp4 with Content-Type: video/mp4, ≥15 seconds, single continuous take. Can I delete an avatar? Yes, via the HeyGen dashboard — note deletion resets monthly on most plans.