Skip to content
Dashboard

HeyGen Video

HeyGen Video generates 5–15 second clips with synchronized dialogue, ambience, and sound effects from text, a first-frame image, or image and video references. It supports 480p, 768p, 1080p, and 2K output. Reference mode charges for input video seconds plus output video seconds; image and audio references have no additional charge. Your use is subject to HeyGen's Terms & Privacy Policies.

View API reference
Price
$0.01, Per second
Lowest available configuration
import { experimental_generateVideo as generateVideo } from 'ai';
const result = await generateVideo({
model: 'heygen/heygen-video-1',
prompt: 'A serene mountain lake at sunrise.'
});
Read docs

Copy link to headingPlayground

Try out HeyGen Video by HeyGen. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.

heygen logo
Images(optional)
Add up to 9 images
Videos(optional)
Add up to 3 videos
Prompt(optional)

Duration8s
5s15s
Resolution
Aspect ratio
heygen logo

Your generated video will appear here.

Copy link to headingProviders

Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.

Checking availability for your team
Provider
Input
Output
Capabilities
ZDR
No Training
Free AI Gateway Credit
Release Date
$0.01/sec+11 more
10/09/2026

Getting started

Generate videos with HeyGen Video using the experimental_generateVideo function from AI SDK 6 or later. AI Gateway handles routing and polls until the video is ready.

Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the video generation quickstart.

index.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'heygen/heygen-video-1',
prompt: 'A drone shot of a coastal cliff with crashing waves at golden hour.',
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Top-level parameters

Load the common, top-level parameters supported across video models.

top-level-params.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'heygen/heygen-video-1',
prompt: 'A drone shot of a coastal cliff with crashing waves at golden hour.',
duration: 5,
aspectRatio: '16:9',
resolution: '1280x720',
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);
ParameterTypeRequiredDescription
promptstringNoText description of the video to generate.
durationnumberNoVideo length in seconds. 5-15 seconds.
resolutionstringNoResolution ('854x480', '1920x1080', '2048x2048').
aspectRatiostringNoAspect ratio ('21:9', '16:9', '4:3', '1:1', '3:4', '9:16').
generateAudiobooleanNoGenerate synchronized audio with the video.

Input limits

InputFormatsSourcesMax countMax sizeLimits
Image—url, base64, buffer9——
Video—url, base64, buffer316 MB0-5s
Audio—url, base64, buffer———

Provider options

Pass provider-specific options under providerOptions.heygen.

provider-options.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'heygen/heygen-video-1',
prompt: 'A drone shot of a coastal cliff with crashing waves at golden hour.',
duration: 5,
providerOptions: {
heygen: {
pollTimeoutMs: 600000,
},
},
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Pass these under providerOptions.heygen in your generateVideo call.

ParameterTypeRequiredDescription
providerOptions.heygen.pollIntervalMsnumberNoHow often to check task status. Defaults to 5000.
providerOptions.heygen.pollTimeoutMsnumberNoMaximum wait time. Defaults to 600000 (10 minutes).