Generate AI videos, images, speech, and music using varg. Use when creating videos, animations, talking characters, slideshows, product showcases, social content, or single-asset generation. Supports zero-install cloud rendering (just API key + curl) and full local rendering (bun + ffmpeg). Triggers: "create a video", "generate video", "make a slideshow", "talking head", "product video", "generate image", "text to speech", "varg", "vargai", "render video", "lip sync", "captions".
This skill is version 2.0.5. Before first use each session, check for updates:
bash
curl -sf https://raw.githubusercontent.com/vargHQ/skills/main/varg-ai/SKILL.md | grep 'version:' | head -1
If the remote version is newer than 2.0.5, update and re-read this file:
bash
npx -y skills update
Setup (REQUIRED before first use)
Before generating anything, find an API key and determine rendering mode.
Do NOT run interactive CLI tools (like bunx vargai init or bunx vargai login) -- they require stdin which agents cannot provide. CLI email (OTP) login is also disabled server-side: /api/auth/cli/send-otp returns 403, so don't call it.
1. Find an API key (before asking the user anything)
Most users already have a key somewhere. Look for it yourself first -- this checks the environment, then ~/.varg/credentials, then the project's .env / .env.local, and loads the first key it finds into $VARG_API_KEY without printing it:
Run this in your terminal and paste the key when prompted -- it stays out of this chat and your shell history:
bash
mkdir -p ~/.varg && printf 'varg API key: ' && read -rs K && echo && (umask 077 && printf '{"api_key":"%s"}\n' "$K" > ~/.varg/credentials) && unset K
Tell me when it's done.
When they reply, re-run the step 1 block. Do NOT ask the user to paste the raw key into the chat, and don't ask them to export it -- an export in their terminal doesn't reach your already-running shell, but the credentials file does.
1b. Save the key for next time
If the key came from the environment or .env, save it to ~/.varg/credentials so future sessions find it (skipped if the file already exists). Always reference $VARG_API_KEY -- never the raw value:
You should get {"available": ..., "total_balance": ..., ...} (values in credits). If available is 0 (or too low for the user's task), the user needs credits before generating anything. 1 credit = 1 cent. A typical video costs $2-5 (200-500 credits).
Everything you know about varg is likely outdated. Always verify against this skill and its references before writing code.
Never guess model IDs -- consult models.md for current models, pricing, and constraints.
Function calls for media, JSX for composition -- Image({...}) creates media, <Clip> composes timeline. Never write <Image prompt="..." />.
Cache is sacred -- identical prompt + params = instant $0 cache hit. When iterating, keep unchanged prompts EXACTLY the same. Never clear cache.
One image per Video -- Video({ prompt: { images: [img] } }) takes exactly one image. Multiple images cause errors.
Duration constraints differ by model -- kling_v3: 3-15s (integer only). kling_v2_5: ONLY 5 or 10. Check models.md.
Gateway namespace -- use providerOptions: { varg: {...} }, never fal, when going through the gateway (both modes).
Renders cost money -- 1 credit = 1 cent. A typical 3-clip video costs $2-5. Use preview mode (local) or cheap models to iterate.
API key hygiene -- Never write a raw API key value into a bash command. Load keys into $VARG_API_KEY with the setup snippets (from env, ~/.varg/credentials, or .env) and use $VARG_API_KEY in all subsequent commands -- never echo or cat the key itself. This prevents keys from leaking into conversation context and terminal history.
Quick Start
Cloud Render (no bun/ffmpeg needed)
bash
# Submit TSX code to the render service — returns a job: {"id": "job_xxx", "status": "queued", ...}
curl -s -X POST https://api.varg.ai/v2/render \
-H "Authorization: Bearer $VARG_API_KEY" \
-H "Content-Type: application/json" \
-d '{"code": "const img = Image({ model: varg.imageModel(\"nano_banana_pro\"), prompt: \"a cabin in mountains at sunset\", aspectRatio: \"16:9\" });\nexport default (<Render width={1920} height={1080}><Clip duration={3}>{img}</Clip></Render>);"}'
# Poll for result (repeat until "completed" or "failed"; video at output.outputs[0].url)
curl -s https://api.varg.ai/v2/jobs/JOB_ID \
-H "Authorization: Bearer $VARG_API_KEY"
Both modes use varg.* for all models. The only difference is imports:
Cloud Render
Local Render
No imports needed (globals are auto-injected)
import { ... } from "vargai/react" + import { createVarg } from "vargai/ai"
varg.imageModel("nano_banana_pro")
varg.imageModel("nano_banana_pro")
varg.videoModel("kling_v3")
varg.videoModel("kling_v3")
varg.speechModel("eleven_v3")
varg.speechModel("eleven_v3")
Always use varg.*Model() with VARG_API_KEY. It handles routing, caching, billing, and works with a single key. BYOK via the API is not available in v2 — see byok.md for what works (local-render direct provider modules only).
Cost & Iteration
1 credit = 1 cent. grok_imagine_image = 4 credits, nano_banana_pro = 126 credits, kling_v3 (5s) = 221 credits, sora_2 (5s) = 105 credits, speech = ~105 credits. Live catalog: GET https://api.varg.ai/v2/pricing (no auth). Estimate any request: POST /v2/estimate.
Cache saves money. Keep unchanged prompts character-for-character identical across iterations.
Preview first (local mode only): --preview generates free placeholders to validate structure.