Create a key
Open app.tryleap.ai/go/api, sign in, and create a key. New workspaces start with $2 of free credit, and the examples on this page cost about $0.69 in all, so you can try them before you add a card. Limits against abuse can withhold the credit, for example after several sign-ups from one network on the same day.Keep the key on your server. It spends your workspace’s balance.
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.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.66. 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.