Skip to main content
The varg SDK (vargai) lets you create AI videos programmatically using JSX syntax. One API key, one API, all providers.

Installation

Setup

Only one key is needed:
Get your key at app.varg.ai or run bunx vargai login.

Two Ways to Use varg

Use createVarg() for one-key access to all providers:

2. Direct Provider Mode (BYOK)

Use individual provider keys directly. See BYOK for details.
Requires individual provider keys in .env:

Core Concepts

Elements vs Components

In varg, media generation happens via element functions that return references:
Critical: Image(), Video(), Speech() are function calls. <Music>, <Captions>, <Title> are JSX components. Never write <Image prompt="..." />.

Automatic Caching

Same props = instant cache hit at $0:

Parallel Generation

Independent elements generate simultaneously:

Package Exports

Environment Variables

Next Steps

Components

All JSX components and their props

AI Models

All supported models with pricing

CLI Reference

Command-line interface

Templates

Copy-paste examples