Skip to content

HeyGenChapter 6 of 6

Video Agent, API and live avatars

  • HeyGen
  • Advanced
  • about 35 minutes

Independent guide. DailyVYBZ is not affiliated with HeyGen or Higgsfield. I am not commissioned or paid by these companies. HeyGen and Higgsfield are names or trademarks of their respective owners. We deliberately don't list specific prices, credits or limits because they change often. You'll find them with the provider.

Goal

You generate videos from a prompt and fetch them automatically through the API, with no surprises around costs and limits.

Requirements

  • A HeyGen account.
  • API balance, separate from your plan credits; it expires after a fixed period.
  • Basic knowledge of the terminal or an automation tool.
  • For webhooks, your own HTTPS URL.

How to do it

  1. Test Video Agent in your browser

    Open Video Agent on the home page. Choose an avatar, then “Chat Mode”, where you review the plan, or “Autopilot”. Set the duration and format, and specify the script and style. Chat and planning are free. Credits are only used once content is generated, that is, from “Proceed” onward.

    In the app: Video AgentChat Mode

  2. Get your key and make your first call

    You can get the key at platform.heygen.com/api-keys. Save it as the environment variable HEYGEN_API_KEY. Send a prompt to POST /v3/video-agents. Poll the status until it says “completed” and a video_url is there.

  3. Webhook instead of constant polling

    Create an endpoint under /v3/webhooks/endpoints. Verify the signature: HMAC-SHA256 over the raw request body, header signature. Respond right away with a 2xx status; the developer docs give the exact deadline. You can spot duplicate deliveries by the video_id and event type.

  4. Understand limits and live avatars

    Know the limits, see “Good to know”. With error 429, wait for the time given in Retry-After. Calculate the per-minute prices in advance. LiveAvatar is a separate platform with its own plans and can only be used with programming.

To copy

Prompt for Video Agent
Create a thirty-second vertical video on the topic "Three mistakes with your first AI video". My avatar speaks calmly and directly to the camera. Follow the script below scene by scene. Show the three mistakes as on-screen text. Use calm stock footage between the scenes.

Style: name "Plain Talk Studio". Colors: [main color with hex code], [accent color with hex code], white #FFFFFF. Clean lines, large sans-serif font, lots of white space. On-screen text slides in gently from below. Transitions are soft crossfades. Calm, clear, confident.

Script:
Scene one: avatar on camera. "Your first AI video doesn't have to be perfect. But these three mistakes will cost you time."
Scene two: on-screen text "Mistake one: numbers not written out". "Write numbers as words. Otherwise the voice reads them wrong."
Scene three: on-screen text "Mistake two: re-rendering again and again". "Listen to the preview first. Then submit."
Scene four: on-screen text "Mistake three: ignoring the watermark". "If you make ads, you need a paid plan."
Scene five: avatar on camera. "Save this. And start your first video today."

Replace the color fields with your real brand colors. Structured according to the prompt guide in the HeyGen docs: duration first, then a paragraph on style, then the script scene by scene.

Minimal API call
curl -X POST "https://api.heygen.com/v3/video-agents" \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Short explainer video: how our team uses AI in everyday office work, about 30 seconds"}'

From the official quickstart guide. The key comes from the environment variable, never directly in the command.

Result

A video that's created through the API and reports back via webhook. Plus, you know the cost per minute and the limits.

Troubleshooting

The webhook signature never matches.

You re-serialized the body as JSON before verifying it. Verify the signature over the raw body. Only convert it after that.

Error 429 Too Many Requests.

You've hit a limit. Wait for the time given in Retry-After, then send again.

The download link no longer works.

Download links are signed and expire. Request the video again and you'll get a fresh link.

Zapier, Make or n8n don't work even though you have credits.

Plan credits don't apply to integrations like HubSpot, Clay, Zapier, Make or n8n. For those, you need your own API balance.

Good to know

  • Video Agent uses Avatar V for real people and Avatar IV for virtual characters. The cost per minute depends on the model and is much higher with Seedance. Before you start, a card shows the estimate.
  • The API bills per minute, depending on the avatar and feature. The prices are in HeyGen's Help Center.
  • The API limits calls per minute and concurrent jobs. The values are in the developer docs; if you get error 429, wait.
  • Script, prompt and number of files are limited; see the developer docs.
  • HeyGen has a connector (MCP) for Claude and other assistants: https://mcp.heygen.com/mcp/v1/. It signs in via OAuth and uses plan credits.
  • LiveAvatar: free to test with short sessions, then its own paid plans.

Caution

  • The API key is a secret. It never belongs in a chat, a script archive or a public repository.
  • Plan credits and API balance are separate. A script that generates lots of videos costs real money. Test with short videos.
  • If you operate HeyGen through an AI assistant, you use plan credits in the process. Make that choice consciously.

Sources

All information comes from HeyGen's official pages. Menu names may differ in your app. Found a mistake? Write to us.

0 of 12 read

Stay up to date

Tips on AI in everyday life, new guides and news about our tools by email.

  • Free, unsubscribe anytime
  • All guides available without signing up
  • The community is in preparation
Sign up on the home page