Generate images, videos, speech, and music using a single varg_xxx API key. No per-provider keys needed.
bun install vargai @vargai/gateway ai| /** | |
| * @jsxImportSource vargai | |
| * | |
| * BEST PRACTICE: Full UGC video pipeline with varg SDK | |
| * | |
| * This script demonstrates the recommended pattern for creating talking-character | |
| * UGC videos with the varg React engine. Key patterns shown: | |
| * | |
| * 1. SPEECH-FIRST WORKFLOW | |
| * - Use a single `await Speech({ children: [...] })` call with all lines |
AI-generated biography videos in TikTok/Reels format. Each template creates a 16-second vertical video with 8 cinematic scenes, voiceover, captions, and background music -- all from a single reference photo.
Included templates:
legend-amy.tsx -- Amy Winehouse (warm jazz/soul, vintage 2000s aesthetic)legend-kurt.tsx -- Kurt Cobain (cool grunge, 1990s blue tones)| /** @jsxImportSource vargai */ | |
| import { Render, Clip, Image, Video, Packshot } from "vargai/react"; | |
| import { fal } from "vargai/ai"; | |
| // βββ Character Reference βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| const CHARACTER = | |
| "https://s3.varg.ai/uploads/images/screenshot-2026-03-02-at-21353-pm_60f009b9.png"; | |
| // βββ Models & Config βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| # Async Render API β Minimal Example | |
| # | |
| # The render service now returns 202 immediately and processes in the background. | |
| # Use polling or SSE to wait for completion. | |
| ## 1. Submit a render (202 instant response) | |
| ```bash | |
| curl -s -X POST https://render-fqb8zg.fly.dev/api/render \ | |
| -H "Content-Type: application/json" \ |
| # Varg Gateway-Centric Authentication & Billing Architecture | |
| ## Overview | |
| This document outlines the proposed architecture where Gateway becomes the single source of truth for user API keys, balance, pricing, and billing. App and Render services consume Gateway APIs and forward user credentials for end-to-end traceability. | |
| --- | |
| ## Current State (Problems) |
| /** @jsxImportSource vargai */ | |
| import { Render, Clip, Image, Video, Music, Title } from "vargai/react"; | |
| import { fal, elevenlabs } from "vargai/ai"; | |
| // ============ REFERENCES ============ | |
| const REFERENCE_IMAGE = | |
| "https://people.com/thmb/JlHU4Q4ISt52omUbCfq3TrXFISY=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc():focal(999x0:1001x2)/sydney-sweeny-2025-emmys-091425-bd17f99cb0db44988bd9a5207a7a3ac9.jpg"; | |
| // ============ CHARACTER CONFIG ============ |