HeyGen Avatar 6 Reference to Video API

Lip-sync animated characters, with gestures, from a reference clip.

PlaygroundAPI
Pricing
~74.52s
POST /v2/heygen-avatar-6-reference-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    "reference_video": "https://segmind-resources.s3.amazonaws.com/input/heygen-avatar-6-reference-to-video-refvideo-5b29b86a.mp4",
11    "reference_image": "https://segmind-resources.s3.amazonaws.com/input/heygen-avatar-6-reference-to-video-refimage-a735e29f.jpg",
12    "script": "Hello there, and welcome! Did you know a red fox makes over twenty different sounds? My three favourites are a yip, a bark, and a happy little gekker - listen closely!",
13    "voice_id": "c30ecab014cb4a8d816d07f6b2b625c8",
14    "motion_prompt": "The fox waves a friendly open paw on 'Hello there, and welcome'. On 'three favourites' it holds up three claws and counts them off one by one. On 'listen closely' it leans in slightly and cups a paw near its ear. Warm, cheerful expression with small natural head movements; keep both paws visible.",
15    "tier": "standard",
16    "resolution": "1080p",
17    "motion_expressiveness": "default",
18}
19job = client.submit_async("heygen-avatar-6-reference-to-video", **payload)
20print(job.request_id)                         # available immediately
21try:
22    result = job.wait(timeout=900, interval=2.0)
23    print(result["status"])                  # COMPLETED
24    print(result.get("output"))              # model output (e.g. video URL)
25except InferenceTimeout as e:
26    print("still running:", e.request_id)    # re-poll later with this id
27except InferenceFailed as e:
28    print("failed:", e.detail)
29
30# Fast models (<=600s) can use the one-liner instead:
31# result = segmind.run("heygen-avatar-6-reference-to-video", **payload)

API Endpoint

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

Parameters

reference_videorequired
string (uri)

Clip of an animated or illustrated character, at least 2 seconds, up to 50 MB. Videos of real people are not accepted; for a person, use heygen-avatar-6-image-to-video.

audiooptional
string (uri)

Speech to lip-sync instead of a Script: WAV, MP3 or M4A, up to 50 MB. The video runs as long as the audio.

languageoptional
string

Script language code like en or pt-BR. Leave empty to auto-detect.

motion_expressivenessoptional
string

default for natural movement, less for a calmer, steadier delivery.

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

Direct gestures, expression and head movement, up to 1,200 characters. Cue actions to words.

output_heightoptional
integer

Optional output height in pixels, even number. Set with output width.

output_widthoptional
integer

Optional output width in pixels, even number. Set with output height.

reference_imageoptional
string (uri)

Optional still of the same character to sharpen its look, up to 32 MB.

resolutionoptional
string

Output resolution, 1080p or 2k. Use 2k for hero placements.

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

Words for the avatar to speak, up to 5,000 characters. Use this or Audio, not both; needs a Voice.

tieroptional
string

standard for full Avatar 6 quality, turbo for faster renders.

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

HeyGen stock voice for the script. Pick one from the voice dropdown.

voice_speedoptional
number

Script speaking speed, 0.5 to 2. Use 1 for a normal pace.

Range: 0.5 - 2

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-reference-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