HeyGen Avatar 6 Identity to Video API

Lip-synced talking-avatar videos from a typed script.

PlaygroundAPI
Pricing
~82.66s
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)

API Endpoint

POSThttps://api.segmind.com/v1/heygen-avatar-6-identity-to-video

Parameters

avatar_idrequired
string

HeyGen public look ID that supports Avatar 6; custom or cloned avatars are refused. Pick a presenter look that fits your brand.

aspect_ratiooptional
string

Frame 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.

Default: "16:9"
Allowed values :
"16:9""9:16""1:1""4:5""5:4""auto"
audiooptional
string (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_expressivenessoptional
string

default for natural movement; less for calmer, steadier delivery. Use less for formal or corporate reads.

Default: "default"
Allowed values :
"default""less"
motion_promptoptional
string

Up to 1,200 characters directing gestures, expression and head movement. Use to add a specific gesture on top of the automatic ones.

resolutionoptional
string

Output resolution, 1080p or 2k. Use 1080p for social, 2k for large screens and fine detail.

Default: "1080p"
Allowed values :
"1080p""2k"
scriptoptional
string

Words 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.

tieroptional
string

standard is the full Avatar 6; turbo renders faster. Use turbo for drafts and batches, standard for final videos.

Default: "standard"
Allowed values :
"standard""turbo"
voice_idoptional
string

Optional 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_speedoptional
number

Speaking speed for the Script, 0.5 to 1.5. Lower for instructional clarity, higher for energetic reads.

Range: 0.5 - 1.5

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. 1
    POST /v2/heygen-avatar-6-identity-to-video

    Submit — returns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Poll — until COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Result — final response body

Status states

QUEUED— Accepted, waiting for a worker
PROCESSING— Running on a worker
COMPLETED— Done — result body is ready
FAILED— Errored (incl. content/RAI blocks)
  • 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.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out