Get your API key
Create a key in Settings → API. Every request below needs it.
Try it in the Playground
Fire a real request from your browser — before writing any code.
Base URL
https://api.heygen.com · Auth header X-Api-Key: <your-key>Your first video
Authenticate
Create a key in Settings → API. For OAuth and rotation, see the API Key guide.
Create a video
Send a prompt to the Video Agent — it scripts, picks the avatar and voice, and renders.
- curl
- Python
- Node.js
Response
Get the result
Poll the session for a
video_id, then the video for its video_url — or skip polling with a webhook via callback_url.- Python
- curl
Response (completed)
Pick your endpoint
Video Agent
Prompt → finished video. Flagship.
Avatar V
Pick the avatar, voice, and script yourself.
Cinematic Avatar
Prompt-driven cinematic shots from avatar looks.
Video Translation
30+ languages with voice cloning and lip-sync.
Text to Speech
Text → natural speech audio.
HyperFrames
HTML/CSS/JS → motion-graphics video. New.
Working from an agent or terminal?
Skip the raw HTTP — both surfaces wrap the same API.MCP Server
Plug HeyGen into Claude, Cursor, or any MCP-capable agent — it handles the calls for you.
CLI
heygen video create, heygen video download — scriptable from any shell or CI job.Build with your stack
Webhooks
Authentication
Limits & Pricing
Migrating from v1/v2? Supported until October 31, 2026 — see the version comparison.
Troubleshooting
Video status is failed
Video status is failed
Inspect
failure_code and failure_message on GET /v3/videos/{video_id}. Full catalog in Error Codes.401 Unauthorized
401 Unauthorized
429 Too Many Requests
429 Too Many Requests
Rate or concurrency limit hit. Respect
Retry-After and back off. See Usage Limits.400 download_failed
400 download_failed
A URL you passed couldn’t be fetched — it must be publicly accessible and point directly at the file.

