Use the HeyGen CLI from KosmoKrator to call HeyGen tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
HeyGen can be configured headlessly with `kosmokrator integrations:configure heygen`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure heygen --set access_token="$HEYGEN_ACCESS_TOKEN" --enable --read allow --write ask --jsonkosmokrator integrations:doctor heygen --jsonkosmokrator integrations:status --json
Credentials
Authentication type: Bearer tokenbearer_token. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
access_token
HEYGEN_ACCESS_TOKEN
Secret secret
yes
Access Token
url
HEYGEN_URL
URL url
no
API Base URL
Call HeyGen Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to HeyGen.
heygen.heygen_list_videos
Read read
List generated videos from HeyGen. Returns video IDs, statuses, and metadata. Use limit and offset for pagination.
Get the status and details of a specific HeyGen video. Returns the video status (pending, processing, completed, failed), download URL when ready, and metadata.
Generate a new AI video on HeyGen. Provide video_inputs defining scenes (avatar, voice, script), optional dimensions, and test mode. Returns a video_id to track generation progress.
List all available voices from HeyGen. Returns voice IDs, display names, supported languages, gender, and preview audio URLs. Use voice IDs when creating videos.
Maximum number of videos to return (default: 10, max: 100).
offset
integer
no
Number of videos to skip for pagination (default: 0).
heygen.heygen_get_video
Get the status and details of a specific HeyGen video. Returns the video status (pending, processing, completed, failed), download URL when ready, and metadata.
Generate a new AI video on HeyGen. Provide video_inputs defining scenes (avatar, voice, script), optional dimensions, and test mode. Returns a video_id to track generation progress.
Array of video input objects. Each defines a scene with properties like character (avatar_id, voice_id), voice_settings, script, and background. Example: [{"character":{"avatar_id":"...","voice_id":"..."},"script":"Hello world"}]
dimension
array
no
Video dimensions as an object with width and height. Example: {"width": 1920, "height": 1080}. Defaults to 1920x1080 if omitted.
test
boolean
no
Set to true to generate a test (preview) video. Defaults to false.
heygen.heygen_list_avatars
List all available talking avatars from HeyGen. Returns avatar IDs, names, preview images, and supported styles. Use avatar IDs when creating videos.
List all available voices from HeyGen. Returns voice IDs, display names, supported languages, gender, and preview audio URLs. Use voice IDs when creating videos.
Maximum number of templates to return (default: 10, max: 100).
offset
integer
no
Number of templates to skip for pagination (default: 0).
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.