POST /v2/render lets you submit varg TSX code and get back a rendered video (or image frames). No Bun, no ffmpeg, no local setup — just an API key and curl.
Rendering is a regular varg job: it uses the same job lifecycle, polling, billing, and file model as every other tool. The render composes a full video from TSX — generating AI assets internally, then stitching everything together.
Quick start
Submit TSX code, poll for the result:Render code uses
fal.*Model() / elevenlabs.*Model() syntax — provider globals are injected server-side. You do not need to call createVarg().Request body
Response
202 Accepted with a standard job object:
GET /v2/jobs/{id}/status reports live progress:
output.outputs[0].url:
Billing
A render bills a flat stitching fee (~5 credits). Each AI sub-generation inside the render (images, video clips, speech, music) is billed separately as its own job at normal model rates. Sub-generation assets are linked to the parent render job — if the render fails partway (e.g. one clip runs out of balance), the completed assets are still in your files and you don’t pay for them twice on retry (cache). Estimate the AI-generation cost of a composition before rendering withPOST /v2/estimate (batch mode).
Output formats
Video (default)
Your TSX is rendered into a single.mp4 with all clips, transitions, audio, and captions composited together. The final URL is in output.outputs[0].url.
Frames
For image-only renders (no video/audio elements), the service can skip video stitching and return individual image frames — faster, and useful for generating image sets.<Image> elements, frames mode is auto-detected.
TSX code requirements
The submittedcode must:
- Import from
vargai/react—Render,Clip,Image,Video,Speech,Music,Captions,Title, etc. - Import providers from
vargai/ai—fal,elevenlabs(these are auto-injected as globals) - Export a default
<Render>element — the root of your video composition
Errors
Standard API error envelope. Render-specific cases:
A render
failed job’s error field describes what went wrong (e.g. a sub-generation failure or a TSX syntax error). Retry with POST /v2/jobs/{id}/retry — cached sub-generations are reused for free.