Search

Search HiAPI models, tools, and resources.

Back to blog
Tutorial5 min read

Speech to Video API: Turn a Script or Audio File into a Talking Video

How HeyGen Avatar IV and Avatar V turn a script or your own audio into a lip-synced presenter video, what $0.15 per second works out to, and which one to pick.

HiAPI EditorialHeyGen Avatar IVHeyGen Avatar VTutorial

Short answer: A speech-to-video API takes a script or an audio file and returns a video of a person saying it, with the lips in sync. On HiAPI there are two: HeyGen Avatar IV turns one photo of your choice into the presenter, and HeyGen Avatar V gives you 497 preset presenters with transparent-background and caption options. Both cost $0.15 per second of video, so a 10-second clip is $1.50 either way, and both accept either a typed script (read by one of 102 voices) or your own recording. Try it now: open the Avatar IV model page, upload a portrait, type a line, and the person starts talking. New accounts get 200 free credits.

The two models at a glance

HeyGen Avatar IVHeyGen Avatar V
Model idheygen-avatar-ivheygen-avatar-v
PresenterYour photo (image_url)One of 497 presets (avatar)
Drive it withprompt (script, up to 5,000 characters) or audio_url (up to 600 s)Same
Voices for scripts102 presets, default Warm Pro NarratorSame 102
Resolution720p or 1080p, same price720p, 1080p or 4k
Aspect ratios16:9, 9:16, 4:5, 5:4, 1:1, auto16:9, 9:16 and more
ExtrasColour or image background fillTransparent WebM, SRT captions
Price$0.15 / second$0.15 / second

Live HiAPI prices, checked October 16, 2026.

You never send a duration. With a script, length follows the words and the voice's pace; with audio, the video runs as long as the recording. Estimating cost means estimating the read-aloud time.

From a script: Avatar IV with one photo

A 9-second 1080p explainer from a single portrait, $1.35:

Hi, I'm Lin. With one photo and a short script, I can present your product or
record a lesson, with natural lip-sync and expressions.

Generate with this script → (upload your photo, voice Cute Chloe - Friendly, 1080p, 16:9)

heygen-avatar-iv, 1080p, 16:9, 9 seconds, $1.35. Sweater, hair and room come from the photo; lips, blinks and nods follow the voice.

{
  "model": "heygen-avatar-iv",
  "input": {
    "image_url": "https://your-cdn.example.com/portrait.jpg",
    "prompt": "Hi, I'm Lin. With one photo and a short script, I can present your product or record a lesson, with natural lip-sync and expressions.",
    "voice": "Cute Chloe - Friendly",
    "resolution": "1080p",
    "aspect_ratio": "16:9"
  }
}

From a script: Avatar V with a preset presenter

No photo needed. Daniel in an office, 1080p, about 8 seconds, $1.20:

Hi, I'm Daniel. Send me your quarterly numbers, and I'll walk your team
through what changed and what to do next.

Generate with this script → (pick an avatar and voice on the page, 1080p, 16:9)

heygen-avatar-v, 1080p, 16:9, about 8 seconds, $1.20.

From your own audio

Replace prompt and voice with audio_url. The lips follow your recording, which can be up to 600 seconds, and the price is still $0.15 per second of output:

{
  "model": "heygen-avatar-v",
  "input": {
    "avatar": "Abigail Office Front",
    "audio_url": "https://your-cdn.example.com/voiceover.mp3",
    "resolution": "1080p",
    "aspect_ratio": "9:16"
  }
}

Use this when a voice actor has already recorded the line, when you're dubbing an existing track, or when the speech comes from a text-to-speech model you prefer.

Which to choose

  • The presenter must be a specific real person, a founder, a teacher, a customer: Avatar IV with their photo.
  • No photo, or you'd rather not use one: Avatar V's presets.
  • Transparent background to composite over slides, or an SRT caption file: Avatar V.
  • 4K: Avatar V. Avatar IV tops out at 1080p.
  • Vertical clips from a portrait photo: Avatar IV with aspect_ratio: "9:16" or auto.
  • Price: identical, so choose on the above.

What it costs

LengthPrice
5 seconds$0.75
10 seconds$1.50
30 seconds$4.50
60 seconds$9.00

$10 buys about 66 seconds, enough to test one photo or preset with several scripts. Trim the warm-up line: every sentence you cut comes off the bill. Failed tasks are refunded.

Integration in three steps

  1. POST /v1/tasks with "model": "heygen-avatar-iv" or "heygen-avatar-v" and the input above. The schema is strict: a stray duration field gets HTTP 400.
  2. Poll GET /v1/tasks/{taskId} or receive a callback, until status is success (treat both fail and failed as failure).
  3. Download output[0].url; the link expires.

FAQ

Can I send audio instead of a script?

Yes, on both models. Put the file's public URL in audio_url and leave out prompt and voice. Audio can be up to 600 seconds.

Do 720p and 1080p cost the same?

Yes, $0.15 per second on both models, so pick 1080p. The API defaults to 720p; set resolution explicitly.

Which languages work?

Scripts can be English or Chinese; audio-driven video follows whatever language is in the recording.

Is there a per-video or monthly fee?

No. You pay per second of generated video, and nothing for failed tasks.

Step-by-step code is in the Avatar IV API tutorial and the Avatar V API tutorial, and a side-by-side in Avatar IV vs Avatar V. Or copy Lin's script above and make your first talking-photo video.

Generate it with HiAPI

Choose a model, enter your prompt, and see the result.

HiAPI Blog

Related articles

HiAPI

Generate it with HiAPI

Start generating