Best for · AI tools

HeyGen API video_inputs: the structure, a working example, and the v3 move

We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.

Verdict Our pick

The bar guide has a call.

The vectaai bar guide pointing at the verdict
  • In HeyGen's v2 API, POST https://api.heygen.com/v2/video/generate takes a required videoinputs array of 1 to 50 scenes.

Compared here

  • 01HeyGen API v2 /v2/video/generate
  • 02video_inputs
  • 03HeyGen API v3 /v3/videos
  • 04Studio scenes

Short answer

In HeyGen's v2 API, POST https://api.heygen.com/v2/video/generate takes a required video_inputs array of 1 to 50 scenes. Each scene is an object with a character (an avatar or a talking_photo), a voice (text, audio or silence) and an optional background (color, image or video), plus optional on-screen text. Top level you can add dimension (default 1920 x 1080), caption, title and callback_id. The response returns data.video_id.

Important: HeyGen's own docs now say v1 and v2 passed their 31 October 2026 sunset and are being removed, so calls "may fail intermittently". The replacement for multi-scene video_inputs is POST /v3/videos with type: "studio" and a scenes array (also 1 to 50 scenes). Below: the v2 structure field by field, a full example, then the same video in v3.

Try HeyGen

Sponsored links. We may earn a commission; it never changes the pick.

At a glance

v2 fields from HeyGen's v2 Create Avatar Video reference (archived copy of docs.heygen.com, 10 March 2026, re-read 4 December 2026; the live page now 404s). v3 fields and sunset status from developers.heygen.com, read 4 December 2026.
ObjectFieldAllowed values (quoted)v3 studio equivalent
charactertypeavatar, talking_photoscene type avatar_video, input type avatar
characteravatar_id / talking_photo_idFrom List All Avatars (V2)input.avatar_id (from GET /v3/avatars)
characterscale, offset, avatar_stylescale 0.0 to 5.0; style circle, closeUp, normalNot in the studio summary we read
voicetypetext, audio, silencescript, audio_url or audio_asset_id (exactly one)
voicespeed, pitch, emotionspeed 0.5 to 1.5; pitch -50 to 50; Excited, Friendly, Serious, Soothing, Broadcastervoice_settings
voiceduration (silence)1.0 to 100.0 secondsimage scene with duration up to 300 s
backgroundtypecolor, image, videocolor, image, video
backgroundplay_style, fitfreeze, loop, fit_to_scene; crop, cover, contain, nonevideo scene playback.mode: freeze, loop, fit_to_scene

Money first. HeyGen pays affiliates 20% to 30% for 6 months, so the HeyGen link here may earn us money if you sign up. The API structure is the same whether you click it or not. We did not call the API for this page. The v2 field list comes from HeyGen's own v2 reference page, which now returns 404 on HeyGen's site, so we read an archived copy of that official page (snapshot 10 March 2026). The sunset status and v3 structure come from HeyGen's live docs, read on 4 December 2026.

Here is the plain version. If you landed here with an old script that builds a video_inputs array, two things are true. One: the structure below will help you read and debug it. Two: that endpoint is on its way out. HeyGen says v1 and v2 passed their sunset on 31 October 2026 and "calls may fail intermittently until removal is complete". So read the v2 part to understand your code, then use the v3 part to move it.

The v2 request at a glance

POST https://api.heygen.com/v2/video/generate

Top-level body fields from HeyGen's v2 reference:

FieldTypeWhat it does
video_inputsarray, required1 to 50 scenes, rendered in order
dimensionobjectwidth default 1920, height default 1080
captionbooleanCaptions; "Only supported for text-based input", default false
titlestringVideo title
callback_idstringYour own ID, returned in the status or webhook payload
folder_idstringFolder to store the video

The reference also said the endpoint "supports Avatar III and Avatar IV".

Inside one video_inputs item

Each item is a scene with up to four parts.

character

FieldApplies toValues from the reference
typebothavatar (default) or talking_photo
avatar_idavatarFrom List All Avatars (V2)
talking_photo_idtalking photoFrom List All Avatars (V2)
scaleboth0.0 to 5.0, default 1
offsetboth{ "x": 0.0, "y": 0.0 } centers the character
avatar_styleavatarcircle, closeUp, normal (default)
talking_photo_styletalking photocircle
circle_background_colorbothHex, for the circle style
mattingbothRemove the photo background
talking_styletalking photostable (default) or expressive
expressiontalking photodefault or happy
super_resolutiontalking photoEnhance image quality
use_avatar_iv_modeltalking photoUse Avatar IV; then prompt sets an Avatar IV motion prompt

voice

FieldApplies toValues from the reference
typealltext, audio or silence
voice_idtextFrom List All Voices (V2)
input_texttextWhat the avatar says
speedtext0.5 to 1.5, default 1
pitchtext-50 to 50, default 0
emotiontextExcited, Friendly, Serious, Soothing, Broadcaster
localetextFor multilingual voices, e.g. en-US, pt-BR
elevenlabs_settingstextAdvanced settings with an ElevenLabs model choice
audio_url / audio_asset_idaudioExactly one of the two; both or neither is an error
durationsilence1.0 to 100.0 seconds

background (optional)

FieldValues from the reference
typecolor, image, video
valueHex color for color, default #FFFFFF
url / image_asset_id / video_asset_idThe uploaded image or video
play_stylefreeze, loop, fit_to_scene
fitcrop, cover (default), contain, none

text (optional)

On-screen text with type: "text", the text itself, font_family, font_size, font_weight, alignment and a required line_height.

A full v2 example

Two scenes: an avatar intro on a blue background, then a talking photo over an image.

{
  "title": "Welcome video",
  "dimension": { "width": 1920, "height": 1080 },
  "caption": false,
  "callback_id": "welcome-001",
  "video_inputs": [
    {
      "character": {
        "type": "avatar",
        "avatar_id": "YOUR_AVATAR_ID",
        "avatar_style": "normal",
        "scale": 1
      },
      "voice": {
        "type": "text",
        "voice_id": "YOUR_VOICE_ID",
        "input_text": "Hi, welcome aboard. Here is what happens next.",
        "speed": 1,
        "emotion": "Friendly"
      },
      "background": { "type": "color", "value": "#87CEEB" }
    },
    {
      "character": {
        "type": "talking_photo",
        "talking_photo_id": "YOUR_TALKING_PHOTO_ID",
        "talking_style": "expressive"
      },
      "voice": {
        "type": "audio",
        "audio_url": "https://example.com/step-two.mp3"
      },
      "background": {
        "type": "image",
        "url": "https://example.com/office.jpg",
        "fit": "cover"
      }
    }
  ]
}

Send it with your API key in the same auth header your old code already uses. A success looks like {"error": null, "data": {"video_id": "..."}}. Then poll the status endpoint with that ID.

The 400 errors the reference warned about

  • circle_background_color not in hex format.
  • An image background with neither url nor image_asset_id.
  • An audio voice with neither, or both, of audio_url and audio_asset_id.

Add the obvious ones: speed outside 0.5 to 1.5, pitch outside -50 to 50, or an avatar_id from a different account.

The same video in v3

HeyGen's mapping table: POST /v2/video/generate becomes POST /v3/videos, and multi-scene calls become type: "studio". Status moves to GET /v3/videos/{video_id}, avatars to GET /v3/avatars, voices to GET /v3/models/audio/voices.

The v3 studio structure, from HeyGen's "Build a video from scenes" doc:

  • scenes: 1 to 50 items, each rendered up to 30 minutes; longer audio must be split across scenes.
  • Scene types: avatar_video, image and video.
  • An avatar_video scene has an input with type: "avatar", an avatar_id and exactly one audio source: script (with optional voice_id), audio_url or audio_asset_id. Optional: voice_settings, engine, motion_prompt, expressiveness, background, remove_background.
  • Backgrounds: { "type": "color", "color": "#RRGGBB" }, or image or video with a source.
  • Sources are { "type": "url", "url": "..." } or { "type": "asset_id", "asset_id": "..." }. No inline base64.
  • Global: aspect_ratio (default 16:9), resolution (720p or 1080p), caption, title, callback_url, callback_id.

Our sketch of the first scene above in v3, built from those field names:

{
  "type": "studio",
  "aspect_ratio": "16:9",
  "resolution": "1080p",
  "title": "Welcome video",
  "callback_id": "welcome-001",
  "scenes": [
    {
      "type": "avatar_video",
      "input": {
        "type": "avatar",
        "avatar_id": "YOUR_V3_AVATAR_ID",
        "script": "Hi, welcome aboard. Here is what happens next.",
        "voice_id": "YOUR_VOICE_ID",
        "background": { "type": "color", "color": "#87CEEB" }
      }
    }
  ]
}

Check the exact nesting against HeyGen's quick example before you ship; the doc we read summarises fields but HeyGen is the final word.

Migration checklist

  1. Re-fetch IDs from GET /v3/avatars and GET /v3/models/audio/voices. Do not assume v2 IDs carry over.
  2. Map each video_inputs item to a scene. Avatar plus text becomes avatar_video with script. Silence becomes an image scene with a duration (up to 300 seconds) or is dropped.
  3. Move value to color for color backgrounds, and wrap image or video URLs in a source.
  4. Replace dimension with aspect_ratio and resolution.
  5. Voice is now optional: v3 "falls back to the avatar's default voice when omitted", where v2 always required voice_id.
  6. One studio video per request. The batch endpoint rejects type: "studio".
  7. Poll GET /v3/videos/{video_id} until status is completed, or pass a callback_url.

If your old code used use_avatar_iv_model, note that Avatar IV is now the default engine in v3; our HeyGen Avatar IV guide covers its credit costs and motion prompts.

Bottom line

video_inputs is a simple idea: an array of scenes, each with a character, a voice and a background. That structure lives on in v3 as scenes, with cleaner sources and fewer fiddly knobs. Since v2 is past its sunset, treat this page as a decoder for old code and a map for moving it. For plan costs, see our HeyGen Creator plan review, and for other tools, HeyGen alternatives. More in the AI tools hub.

What we could not verify

The live v2 reference page returns 404, so v2 fields come from the archived official copy dated 10 March 2026. The v3 studio doc summary we read did not show scale, offset or avatar style equivalents. The API key header for v3 was not on the pages we read; check HeyGen's API key doc.

Questions people ask

What is video_inputs in the HeyGen API?

It is the required array in the v2 Create Avatar Video request. HeyGen's reference describes each item as a scene: the avatar, background, voice and script together. The array must hold between 1 and 50 items, and the scenes render in order into one video. Each item needs a character and a voice; background and text are optional.

Does the HeyGen v2 API still work?

Not reliably. HeyGen's endpoint version comparison page says v1 and v2 reached end of support at the 31 October 2026 sunset, v3 is the supported API, and v1 and v2 endpoints are being removed, so calls may fail intermittently until removal is complete. Move any production code to POST /v3/videos.

What replaces video_inputs in HeyGen API v3?

A scenes array on POST /v3/videos with type set to studio. HeyGen's docs list three scene types: avatar_video, image and video, with 1 to 50 scenes per request and up to 30 minutes per scene. Status moves from GET /v2/videos/{id} to GET /v3/videos/{video_id}, polled until status is completed.

How do I use a talking photo instead of an avatar in video_inputs?

Set character.type to talking_photo and pass talking_photo_id instead of avatar_id. The v2 reference adds talking photo only options: talking_style stable or expressive, expression default or happy, super_resolution, and use_avatar_iv_model with an optional Avatar IV motion prompt. Avatar style options apply only to the avatar type.

Why does my HeyGen video_inputs request return 400?

Common causes in the v2 reference's error notes: circle_background_color not in hex, an image background with neither url nor image_asset_id, or an audio voice with neither or both of audio_url and audio_asset_id. Also check speed stays between 0.5 and 1.5 and pitch between -50 and 50.

Sources

Every fact above comes from these pages. Prices change, so each one carries the date we read it.

  1. HeyGen docs: Endpoint version comparison (v1/v2 sunset), checked 4 Dec 2026
  2. HeyGen docs: Build a video from scenes (v3 studio), checked 4 Dec 2026
  3. HeyGen v2 reference: Create Avatar Video (archived copy of the official page, 10 March 2026), checked 4 Dec 2026
  4. HeyGen docs index (llms.txt), checked 4 Dec 2026