Skip to main content
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:
While the render runs, GET /v2/jobs/{id}/status reports live progress:
On completion, the final video is in output.outputs[0].url:
Prefer webhooks over polling for long renders: set options.webhook_url in the request and varg will POST the job snapshot to your URL when the render finishes. See webhooks.

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 with POST /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.
If your TSX contains only <Image> elements, frames mode is auto-detected.

TSX code requirements

The submitted code must:
  1. Import from vargai/reactRender, Clip, Image, Video, Speech, Music, Captions, Title, etc.
  2. Import providers from vargai/aifal, elevenlabs (these are auto-injected as globals)
  3. Export a default <Render> element — the root of your video composition
Render code uses fal.*Model(), elevenlabs.*Model(), etc. — not varg.*Model(). Provider globals are injected server-side. The createVarg() pattern is for local rendering only.
See the components reference for all available JSX components and props.

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.

Asset generation vs full renders