Use this file to discover all available pages before exploring further.
Migrating from v1 or v2? The legacy /v1 and /v2 endpoints will remain fully supported until October 31, 2026, but all new capabilities — including the CLI, MCP, Voice design API, improved error handling, the latest HeyGen models such as lipsync — are available exclusively on v3. We recommend migrating all new and existing integrations to v3. Read more here.
1
Get your API key
Go to Settings → API in the HeyGen dashboard and generate a key. Save it — you can’t view it again.
export HEYGEN_API_KEY="your-api-key-here"
2
Create a video
Send a prompt to the Video Agent and let it handle the rest:
curl
Python
Node.js
Request
curl -X POST "https://api.heygen.com/v3/video-agents" \ -H "X-Api-Key: $HEYGEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt": "A presenter explaining our product launch in 30 seconds"}'
Request
import requestsresp = requests.post( "https://api.heygen.com/v3/video-agents", headers={"X-Api-Key": HEYGEN_API_KEY}, json={"prompt": "A presenter explaining our product launch in 30 seconds"},)data = resp.json()["data"]print(data["video_id"])