Skip to main content

Video Templates API

Render MP4 video the same way you render images: build a video template once, then render it with different variables per request. Templates come in two kinds — timeline templates built in the visual studio, and code templates written as single-file Remotion (React) scenes — and both render through the same endpoint. All endpoints live under /video and accept your normal API key as a Bearer token.
Video renders are long requests: expect up to a few minutes for a full render. The request waits and returns the finished MP4 URL. Each render consumes credits like any other generation.

List your video templates

Returns { "templates": [...] } with each template’s uid, kind, dimensions, fps, duration and variable definitions — everything you need to render it.

Render a template — MP4 or GIF

format is "mp4" (default) or "gif" — the same template and the same render, encoded for places an MP4 cannot autoplay. Timeline templates are palette-converted and capped at 15fps / 720px wide so files stay shareable; code (tsx) templates encode GIF natively at half the composition’s frame rate with no width cap. Response:
For timeline templates, variable VALUES are validated against the declared definitions — a malformed value (bad colour, unsafe URL, missing required) returns 422 with code: "invalid_variable", while unknown variable names are ignored by design. Code (tsx) templates receive variables directly as component props with no server-side validation — the scene’s zod defaults govern what renders.

Get a template’s variables

Use this to build forms or map spreadsheet columns before rendering.

Generate a template with AI

Describe the video; the API designs a motion brief, writes the scene code, compiles it, renders preview frames and reviews them visually — then returns a draft template ready to render or refine in the studio.
Response: { "template": {...}, "previewUrl": "https://..." } — the template’s schema fields (texts, colours, optional image) are derived from the generated scene, so the result is immediately parameterisable. Generation takes 30–60 seconds and is metered as one render.

Preview a single frame

Renders one frame to PNG — a cheap way to check a variable set before committing to a full video render. Metered as one image. Code (tsx) templates only: timeline templates return 501 with code: "preview_not_supported" (the studio previews them live in the browser instead).

Template management

Code (tsx) templates pass a compile gate on every create and update: imports are restricted to remotion (including @remotion/* subpackages), react and zod, and a template that does not build is rejected with 422 and the compiler errors, so a template that saves is a template that renders.