The HeyGen CLI gives developers and AI agents command-line access to HeyGen’s video platform. It wraps the v3 API, outputs structured JSON by default, and works out of the box in scripts, CI pipelines, and agent workflows.Documentation Index
Fetch the complete documentation index at: https://developers.heygen.com/llms.txt
Use this file to discover all available pages before exploring further.
1. Install the CLI
~/.local/bin.
Verify the installation:
The CLI ships as a single binary with no runtime prerequisites. macOS (Apple Silicon and Intel) and Linux (x64 and arm64) are supported. Windows support is coming soon — WSL is recommended in the meantime.
2. Authenticate
Log in with your API key from API dashboard:~/.heygen/credentials.
For CI/Docker/agent environments, set the environment variable instead — it takes precedence over stored credentials:
3. Create a Video
Send a prompt to the Video Agent and let it handle avatar, voice, and layout:Output
video create with a JSON body:
--request-schema on any command to discover the expected JSON fields — no auth required:
4. Check Status
Poll for the result using thevideo_id returned from step 3:
Output
pending → processing → completed or failed. If the video fails, the response includes failure_code and failure_message fields.
Tip: Add
--wait to the create command to block until the video is ready instead of polling manually. The default timeout is 20 minutes — override with --timeout 30m. On timeout, the CLI exits with code 4 and prints the last known resource state along with a hint to resume polling manually.5. Download the Video
Once complete, download to a local file:Output

