KosmoKrator

data

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.

HeyGen CLI Setup

HeyGen can be configured headlessly with `kosmokrator integrations:configure heygen`.

Install, configure, and verify
# 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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
access_token HEYGEN_ACCESS_TOKEN Secret secret yes Access Token
url HEYGEN_URL URL url no API Base URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

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

Discovery

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

Discovery commands
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

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

heygen.heygen_list_videos

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

Read read
Parameters
limit, offset
Generic call
kosmo integrations:call heygen.heygen_list_videos '{"limit":1,"offset":1}' --json
Shortcut
kosmo integrations:heygen heygen_list_videos '{"limit":1,"offset":1}' --json

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.

Read read
Parameters
video_id
Generic call
kosmo integrations:call heygen.heygen_get_video '{"video_id":"example_video_id"}' --json
Shortcut
kosmo integrations:heygen heygen_get_video '{"video_id":"example_video_id"}' --json

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.

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

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.

Read read
Parameters
none
Generic call
kosmo integrations:call heygen.heygen_list_avatars '{}' --json
Shortcut
kosmo integrations:heygen heygen_list_avatars '{}' --json

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.

Read read
Parameters
none
Generic call
kosmo integrations:call heygen.heygen_list_voices '{}' --json
Shortcut
kosmo integrations:heygen heygen_list_voices '{}' --json

heygen.heygen_get_current_user

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

Read read
Parameters
none
Generic call
kosmo integrations:call heygen.heygen_get_current_user '{}' --json
Shortcut
kosmo integrations:heygen heygen_get_current_user '{}' --json

heygen.heygen_list_templates

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

Read read
Parameters
limit, offset
Generic call
kosmo integrations:call heygen.heygen_list_templates '{"limit":1,"offset":1}' --json
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 2 parameters
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 1 parameters
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 3 parameters
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 0 parameters
Schema command
kosmo integrations:schema heygen.heygen_list_avatars --json
ParameterTypeRequiredDescription
No parameters.
heygen.heygen_list_voices 0 parameters
Schema command
kosmo integrations:schema heygen.heygen_list_voices --json
ParameterTypeRequiredDescription
No parameters.
heygen.heygen_get_current_user 0 parameters
Schema command
kosmo integrations:schema heygen.heygen_get_current_user --json
ParameterTypeRequiredDescription
No parameters.
heygen.heygen_list_templates 2 parameters
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.