Skip to main content
A video template renders as an MP4. Each second of the video counts as one generation, and as two at 60 fps. Generate videos explains how to design one. renderAndWaitVideo and renderVideo take a template id and an options object.
string
required
The id of a video template, for example tpl_xxx.
Modification[]
The values to put into the template’s layers. A video layer takes a src, and an audio track takes a src with its name. Modifications lists the fields each layer accepts.

Render and wait for the URL

renderAndWaitVideo returns { result } with the URL of the MP4, or { error }.

Follow the progress

renderVideo returns an async iterator of events. The last event is done or error.
A refused request, such as an invalid API key or a used-up quota, gives one error event. When the connection drops, renderVideo reads the same video again by its id, up to four times, and goes on with its events. It never renders the video twice.

Start a video without waiting

createVideo returns { result } with the id of the video at once, or { error }. Read the video later with getVideo.

Read a video again

The video renders to its end also when your process stops. Keep its id from the created event to read it later. getVideo returns { result } with the status of the video, or { error }:
watchVideo returns the events of the video again, from the latest one, as renderVideo does: