Create a key
Open app.tryleap.ai/go/api, sign in, and create a key. API keys run on paid credit, so add $5 on the same page before your first call. The first top-up has no card fee, $5 is the smallest, and the examples on this page cost about $0.69 in all. Until then a key’s runs get a Keep the key on your server. It spends your workspace’s balance.
402 with the code top_up_required.Make an image
prefer: wait=60 holds the request open until the image is ready, for up to 60 seconds, so one request gets you the result. Most images are back in well under that, but some models take longer (FLUX 3 Image’s slowest runs take over a minute), so keep the poll below for a run that is still going when the wait ends.To run the Node.js version, save it as quickstart.mjs and run node quickstart.mjs (Node 18 or later). For the Python version, run pip install requests first. The curl version needs jq.Read and save the result
The answer is a generation. Its Anyone with the
output holds signed links to the files:url can download the file until expires_at, without an API key. Links expire after 24 hours, so download what you keep. The Node.js and Python scripts above save the image as scarf.jpg. With curl:-L follows the redirect to storage that large files, such as videos, get. Reading the generation again with GET /v1/generations/{id} signs fresh links. The full object is in Generations.Make a video
Video takes a minute or more, longer than one request can wait. This script starts a clip without waiting, then long-polls it: each read waits up to 60 seconds for the clip to finish. It gives up after 15 minutes, and saves the clip as This 4-second clip with sound costs $0.80. Generations shows the same long-poll in TypeScript and Python.
heron.mp4. Save it as video.sh and run bash video.sh. It needs jq 1.6 or later.Next
Find a model
Browse the catalog and read what each model takes.
Send a photo
Upload a file, then animate or edit it.
Turn a photo into a video
Upload a product photo, animate it with Veo and save the clip.
Add generation to a Next.js app
Start runs from a route handler and show the result on a page.