KosmoKrator

ai

HeyGen CLI for AI Agents

Use the HeyGen CLI from KosmoKrator to call HeyGen tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Bearer token auth

HeyGen CLI Setup

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 --json
kosmokrator integrations:doctor heygen --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
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.

kosmo integrations:call heygen.heygen_list_videos '{
  "limit": 1,
  "offset": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:heygen heygen_list_videos '{
  "limit": 1,
  "offset": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs heygen --json
kosmo integrations:docs heygen.heygen_list_videos --json
kosmo integrations:schema heygen.heygen_list_videos --json
kosmo integrations:search "HeyGen" --json
kosmo integrations:list --json

All CLI Functions

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.

Parameters
limit, offset

Generic CLI call

kosmo integrations:call heygen.heygen_list_videos '{"limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:heygen heygen_list_videos '{"limit":1,"offset":1}' --json

heygen.heygen_get_video

Read read

Get the status and details of a specific HeyGen video. Returns the video status (pending, processing, completed, failed), download URL when ready, and metadata.

Parameters
video_id

Generic CLI call

kosmo integrations:call heygen.heygen_get_video '{"video_id":"example_video_id"}' --json

Provider shortcut

kosmo integrations:heygen heygen_get_video '{"video_id":"example_video_id"}' --json

heygen.heygen_create_video

Write write

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.

Parameters
video_inputs, dimension, test

Generic CLI call

kosmo integrations:call heygen.heygen_create_video '{"video_inputs":"example_video_inputs","dimension":"example_dimension","test":true}' --json

Provider shortcut

kosmo integrations:heygen heygen_create_video '{"video_inputs":"example_video_inputs","dimension":"example_dimension","test":true}' --json

heygen.heygen_list_avatars

Read read

List all available talking avatars from HeyGen. Returns avatar IDs, names, preview images, and supported styles. Use avatar IDs when creating videos.

Parameters
none

Generic CLI call

kosmo integrations:call heygen.heygen_list_avatars '{}' --json

Provider shortcut

kosmo integrations:heygen heygen_list_avatars '{}' --json

heygen.heygen_list_voices

Read read

List all available voices from HeyGen. Returns voice IDs, display names, supported languages, gender, and preview audio URLs. Use voice IDs when creating videos.

Parameters
none

Generic CLI call

kosmo integrations:call heygen.heygen_list_voices '{}' --json

Provider shortcut

kosmo integrations:heygen heygen_list_voices '{}' --json

heygen.heygen_get_current_user

Read read

Get the current authenticated HeyGen user's account information, including plan details, remaining credits, and usage statistics.

Parameters
none

Generic CLI call

kosmo integrations:call heygen.heygen_get_current_user '{}' --json

Provider shortcut

kosmo integrations:heygen heygen_get_current_user '{}' --json

heygen.heygen_list_templates

Read read

List available video templates from HeyGen. Returns template IDs, names, thumbnails, and metadata. Use limit and offset for pagination.

Parameters
limit, offset

Generic CLI call

kosmo integrations:call heygen.heygen_list_templates '{"limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:heygen heygen_list_templates '{"limit":1,"offset":1}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

heygen.heygen_list_videos

List generated videos from HeyGen. Returns video IDs, statuses, and metadata. Use limit and offset for pagination.

Operation
Read read
Schema command
kosmo integrations:schema heygen.heygen_list_videos --json
ParameterTypeRequiredDescription
limit integer no 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.

Operation
Read read
Schema command
kosmo integrations:schema heygen.heygen_get_video --json
ParameterTypeRequiredDescription
video_id string yes The unique identifier of the video to retrieve.

heygen.heygen_create_video

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.

Operation
Write write
Schema command
kosmo integrations:schema heygen.heygen_create_video --json
ParameterTypeRequiredDescription
video_inputs array yes 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.

Operation
Read read
Schema command
kosmo integrations:schema heygen.heygen_list_avatars --json
ParameterTypeRequiredDescription
No parameters.

heygen.heygen_list_voices

List all available voices from HeyGen. Returns voice IDs, display names, supported languages, gender, and preview audio URLs. Use voice IDs when creating videos.

Operation
Read read
Schema command
kosmo integrations:schema heygen.heygen_list_voices --json
ParameterTypeRequiredDescription
No parameters.

heygen.heygen_get_current_user

Get the current authenticated HeyGen user's account information, including plan details, remaining credits, and usage statistics.

Operation
Read read
Schema command
kosmo integrations:schema heygen.heygen_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

heygen.heygen_list_templates

List available video templates from HeyGen. Returns template IDs, names, thumbnails, and metadata. Use limit and offset for pagination.

Operation
Read read
Schema command
kosmo integrations:schema heygen.heygen_list_templates --json
ParameterTypeRequiredDescription
limit integer no 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.