How it works
Send a prompt
POST a text description to
/v3/video-agents. Optionally attach files, pick an avatar, or apply a style.Agent produces your video
The agent writes a script, selects visuals, and renders the video asynchronously. You receive a
video_id and session_id immediately.Authentication
Every request requires either an API key or an OAuth Bearer token:| Header | Value |
|---|---|
X-Api-Key | Your HeyGen API key |
Authorization | Bearer YOUR_ACCESS_TOKEN (OAuth) |
Quick start
Response
Two modes of operation
Video Agent supports two workflows depending on how much control you need:| Mode | Endpoint | Best for |
|---|---|---|
| One-shot | POST /v3/video-agents | Fire-and-forget video generation. Send a prompt, get a video. |
| Interactive session | POST /v3/video-agents/sessions | Review storyboards, send follow-up messages, and iterate before generating. |
Key concepts
- Session — Every Video Agent request creates a session (
session_id). Sessions track the agent’s work: prompt, storyboard, generated assets, and final video. - Video ID — The
video_idreturned in the response is used to poll for the final video viaGET /v3/videos/{video_id}. - Styles — Curated visual templates that control scene composition, pacing, and aesthetics. Browse them via
GET /v3/video-agents/styles. See Styles & References. - File attachments — Images, videos, audio, and PDFs you provide as context. The agent uses these as visual references or content sources. See Upload Assets.
Error handling
All Video Agent endpoints return errors in a consistent format:| Status | Meaning |
|---|---|
400 | Invalid request parameters. Check the param field for which field caused the error. |
401 | Authentication failed. Verify your API key or Bearer token. |
429 | Rate limit exceeded. Retry after the number of seconds in the Retry-After header. |

