HeyGen Avatar 6 Identity to Video API
Lip-synced talking-avatar videos from a typed script.
POST /v2/heygen-avatar-6-identity-to-video · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "avatar_id": "51753ef612cc482cb46084c3165e1d20",
11 "script": "Here's how I'd lay out a small studio in three zones. First, the bed tucks into the far corner, away from the door. Second, the kitchen runs along this wall. And third, right under the window, the desk, where the daylight is best. Three zones, one room, no clutter.",
12 "tier": "standard",
13 "resolution": "1080p",
14 "aspect_ratio": "16:9",
15}
16job = client.submit_async("heygen-avatar-6-identity-to-video", **payload)
17print(job.request_id) # available immediately
18try:
19 result = job.wait(timeout=900, interval=2.0)
20 print(result["status"]) # COMPLETED
21 print(result.get("output")) # model output (e.g. video URL)
22except InferenceTimeout as e:
23 print("still running:", e.request_id) # re-poll later with this id
24except InferenceFailed as e:
25 print("failed:", e.detail)
26
27# Fast models (<=600s) can use the one-liner instead:
28# result = segmind.run("heygen-avatar-6-identity-to-video", **payload) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "avatar_id": "51753ef612cc482cb46084c3165e1d20",
11 "script": "Here's how I'd lay out a small studio in three zones. First, the bed tucks into the far corner, away from the door. Second, the kitchen runs along this wall. And third, right under the window, the desk, where the daylight is best. Three zones, one room, no clutter.",
12 "tier": "standard",
13 "resolution": "1080p",
14 "aspect_ratio": "16:9",
15}
16job = client.submit_async("heygen-avatar-6-identity-to-video", **payload)
17print(job.request_id) # available immediately
18try:
19 result = job.wait(timeout=900, interval=2.0)
20 print(result["status"]) # COMPLETED
21 print(result.get("output")) # model output (e.g. video URL)
22except InferenceTimeout as e:
23 print("still running:", e.request_id) # re-poll later with this id
24except InferenceFailed as e:
25 print("failed:", e.detail)
26
27# Fast models (<=600s) can use the one-liner instead:
28# result = segmind.run("heygen-avatar-6-identity-to-video", **payload)API Endpoint
https://api.segmind.com/v1/heygen-avatar-6-identity-to-videoParameters
avatar_idrequiredstringHeyGen public look ID that supports Avatar 6; custom or cloned avatars are refused. Pick a presenter look that fits your brand.
aspect_ratiooptionalstringFrame shape; auto follows the look's photo. 16:9 for web and courses, 9:16 for Shorts and Reels, 1:1 or 4:5 for feeds.
"16:9""16:9""9:16""1:1""4:5""5:4""auto"audiooptionalstring (uri)Speech to lip-sync instead of a Script: WAV, MP3 or M4A, up to 50 MB. Use a recorded voiceover; the clip matches its length.
motion_expressivenessoptionalstringdefault for natural movement; less for calmer, steadier delivery. Use less for formal or corporate reads.
"default""default""less"motion_promptoptionalstringUp to 1,200 characters directing gestures, expression and head movement. Use to add a specific gesture on top of the automatic ones.
resolutionoptionalstringOutput resolution, 1080p or 2k. Use 1080p for social, 2k for large screens and fine detail.
"1080p""1080p""2k"scriptoptionalstringWords for the avatar to speak, up to 5,000 characters; use Script or Audio, not both. Keep it tight, since length sets the clip length.
tieroptionalstringstandard is the full Avatar 6; turbo renders faster. Use turbo for drafts and batches, standard for final videos.
"standard""standard""turbo"voice_idoptionalstringOptional HeyGen stock voice for the Script; cloned voices are refused. Leave empty for the look's own voice, or match the look's tone.
voice_speedoptionalnumberSpeaking speed for the Script, 0.5 to 1.5. Lower for instructional clarity, higher for energetic reads.
Response Type
Returns: Video
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/heygen-avatar-6-identity-to-videoSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out