# Leap > Generate images, video and audio with Veo, Kling, Seedance, FLUX, GPT Image, ElevenLabs and more, through one REST API and one balance. No key yet? Browse models and schemas at https://api.tryleap.ai/v1/public/models. > ## Agent Instructions > Leap's API is at https://api.tryleap.ai. Send the key in the x-api-key header or as Authorization: Bearer; keys start with leap_. > Take model IDs and input schemas from GET /v1/models/{creator}/{name}, or from https://api.tryleap.ai/v1/public/models without a key. Never guess an input field: unknown fields are a 400. > Model inputs take uploaded file IDs (file_...), never URLs. > To give a coding agent the whole API, install the Leap skill: curl -fsSL https://www.tryleap.ai/install.sh | sh > The full OpenAPI 3.1 spec is at https://www.tryleap.ai/docs/openapi.json. - [Leap API](https://www.tryleap.ai/docs/index.md): Generate images, video and audio with Veo, Kling, Seedance, FLUX, GPT Image, ElevenLabs and more, through one REST API and one balance. - [Quickstart](https://www.tryleap.ai/docs/quickstart.md): Create an API key, make an image in one request and save it, then start a video and poll it until it's done. - [Authentication](https://www.tryleap.ai/docs/authentication.md): Create an API key, send it in the x-api-key header or as a Bearer token, and know what it can do and when it expires. - [Models and schemas](https://www.tryleap.ai/docs/models.md): List every model and preset, read the JSON Schema of the input each one takes, and follow a model through preview, stable and deprecated. - [Generations](https://www.tryleap.ai/docs/generations.md): Start a run of any model or preset, get its result by waiting in the request, long-polling, a webhook or polling, read its outputs, cancel it, list your runs, and start up to 50 at once. - [Webhooks](https://www.tryleap.ai/docs/webhooks.md): Get a signed HTTPS request when a generation or batch finishes, for one run or for every run, and verify it with the Standard Webhooks libraries. - [Files and uploads](https://www.tryleap.ai/docs/files.md): Upload photos, videos and sounds, pass their file IDs as model inputs, and keep an output as a file to feed the next run. - [Pricing and credits](https://www.tryleap.ai/docs/pricing.md): How a model's price is written, how to price a run before you start it, how holds, charges and your balance work, and the limits before your first top-up. - [Errors and retries](https://www.tryleap.ai/docs/errors.md): The one error shape every endpoint answers with, every error code and what to do about it, which requests are safe to retry, and the rate limits. - [Turn a photo into a video](https://www.tryleap.ai/docs/examples/photo-to-video.md): Upload a product photo, animate it into a 4-second vertical clip with Veo 3.1 Fast, wait for it, and save the video, in one Node.js or Python script. - [Add generation to a Next.js app](https://www.tryleap.ai/docs/examples/nextjs.md): Start images and videos from Next.js route handlers with your key on the server, then poll from a client component and show the result. - [Use Leap from your agent](https://www.tryleap.ai/docs/agents.md): Install the Leap skill so your coding agent builds with the API correctly, connect an agent to Leap's MCP server to generate media directly, or point any LLM at these docs. - [API reference](https://www.tryleap.ai/docs/api-reference/introduction.md): Every endpoint of the Leap API, with its parameters, responses, errors and the scope it needs, built from the API's own code. - [List models](https://www.tryleap.ai/docs/api-reference/models/list-models.md): Every model and preset your key can run, with its price, in one answer. Filter it on your side by `modality` or `tasks`. Read one model for the JSON Schema of its input. - [Retrieve a model](https://www.tryleap.ai/docs/api-reference/models/retrieve-a-model.md): One model or preset with `input_schema`, the JSON Schema (2020-12) of the `input` it takes. Build your request from it: required fields, allowed values and defaults are all there, and unknown fields are refused. - [List models without a key](https://www.tryleap.ai/docs/api-reference/models/list-models-without-a-key.md): The same catalog as `GET /v1/models`, for anyone: browse models and prices before you sign up. - [Retrieve a model without a key](https://www.tryleap.ai/docs/api-reference/models/retrieve-a-model-without-a-key.md): The same as `GET /v1/models/{creator}/{name}`, for anyone. - [Create a quote](https://www.tryleap.ai/docs/api-reference/quotes/create-a-quote.md): The exact price of a run, without running it or holding credit. It takes the same body as `POST /v1/generations`, checks the input against the model's schema and fills in its defaults, so an input the schema refuses gets the same `400`. It can't tell whether the model will accept the prompt itself. - [List generations](https://www.tryleap.ai/docs/api-reference/generations/list-generations.md): Your workspace's generations, newest first, 50 to a page by default. Filter by model, status or where they were started. To read the next page, send `next_cursor` as `cursor` with the same filters. - [Create a generation](https://www.tryleap.ai/docs/api-reference/generations/create-a-generation.md): Starts a run of any model or preset. Every model takes this same shape; only `input` differs, as the model's `input_schema` says. The price is held from your balance first, and charged only if the run succeeds. - [Retrieve a generation](https://www.tryleap.ai/docs/api-reference/generations/retrieve-a-generation.md): A generation's status, outputs and cost. Each read signs fresh output links, valid for 24 hours. - [Cancel a generation](https://www.tryleap.ai/docs/api-reference/generations/cancel-a-generation.md): Stops a queued or running generation and releases its hold; if the provider finishes it anyway, the result is thrown away and nothing is charged. A generation that already ended comes back as it is. Two kinds can't be stopped once started and answer `409`: a run at a provider that bills it either wa… - [Keep an output as a file](https://www.tryleap.ai/docs/api-reference/generations/keep-an-output-as-a-file.md): Turns an image output of a succeeded generation into a file of your workspace, so you can pass its ID to the next run without downloading and uploading it. Calling it again returns the same file. Other outputs answer `400`. - [Create a batch](https://www.tryleap.ai/docs/api-reference/batches/create-a-batch.md): Starts up to 50 generations in one request. They're priced and held together, so either all start or none do, and each then runs as its own generation with this batch's `batch_id`. Read each one with `GET /v1/generations/{id}`. - [Retrieve a batch](https://www.tryleap.ai/docs/api-reference/batches/retrieve-a-batch.md): A batch with every generation in it, each as `GET /v1/generations/{id}` would return it. Send `Prefer: wait=60` to hold the read until every run is final or 60 seconds pass. While any run isn't final, `Retry-After` says how many seconds to wait before the next read. - [List webhook endpoints](https://www.tryleap.ai/docs/api-reference/webhooks/list-webhook-endpoints.md): Your workspace's webhook endpoints, newest first. Their secrets are never listed. - [Create a webhook endpoint](https://www.tryleap.ai/docs/api-reference/webhooks/create-a-webhook-endpoint.md): Starts sending your workspace's events to an https URL: every type by default (`["*"]`, including types added later), or the ones you list. Runs started from the API, the studio and MCP all send events. The answer holds the endpoint's signing secret, shown only here and when you rotate it. A workspa… - [Retrieve a webhook endpoint](https://www.tryleap.ai/docs/api-reference/webhooks/retrieve-a-webhook-endpoint.md): One endpoint, without its secret. - [Delete a webhook endpoint](https://www.tryleap.ai/docs/api-reference/webhooks/delete-a-webhook-endpoint.md): Removes an endpoint. Its events stop going there. - [Update a webhook endpoint](https://www.tryleap.ai/docs/api-reference/webhooks/update-a-webhook-endpoint.md): Changes any of `url`, `events` and `description` (null clears it), and turns deliveries off and on with `disabled`. `{"disabled": false}` turns back on an endpoint Leap disabled after 72 hours of failures, and clears `disabled_reason`. Fields you leave out stay as they are. - [Rotate a webhook secret](https://www.tryleap.ai/docs/api-reference/webhooks/rotate-a-webhook-secret.md): Makes a new signing secret and returns it, shown only here. For 24 hours the old secret signs too, as a second signature in `webhook-signature`, so you can deploy the new one without dropping events. Rotating again within those 24 hours drops the oldest. - [Send a test event](https://www.tryleap.ai/docs/api-reference/webhooks/send-a-test-event.md): Sends a `webhook.test` event to this endpoint only, once, even if it's disabled, and answers with the delivery and how the try went. The event's `data.object` is the endpoint, never its secret. Tests and redeliveries share a budget of 100 an hour per workspace. - [Retrieve the default webhook secret](https://www.tryleap.ai/docs/api-reference/webhooks/retrieve-the-default-webhook-secret.md): The secret that signs events sent to the `webhook` URL a generation or batch request names. It's made the first time you read it. Keep it in your server's environment. - [List events](https://www.tryleap.ai/docs/api-reference/events/list-events.md): Your workspace's events from the last 30 days, newest first, optionally only some types. Use it to catch up after your endpoint was down. - [Retrieve an event](https://www.tryleap.ai/docs/api-reference/events/retrieve-an-event.md): One event, with its `data.object` as the API returns it now, so its output links are fresh. - [List an event's deliveries](https://www.tryleap.ai/docs/api-reference/events/list-an-events-deliveries.md): Where the event went, newest first: one delivery per URL, each with every try, the status your server answered, and when Leap tries again. - [Redeliver an event](https://www.tryleap.ai/docs/api-reference/events/redeliver-an-event.md): Sends the event again: to one endpoint with `{"endpoint": "we_..."}`, or else to every enabled endpoint that subscribes to its type and to the webhook URL its request named. It keeps the event's `webhook-id`, so a receiver that skips duplicates handles it once. A disabled endpoint, or nowhere to sen… - [Upload an image](https://www.tryleap.ai/docs/api-reference/files/upload-an-image.md): Stores an image you send as the request body, with no multipart encoding: `curl --data-binary @photo.jpg`. PNG, JPEG or WebP, up to 4 MB; the type is read from the bytes. Pass the returned ID in a model's input. Send videos and sounds through `POST /v1/uploads` instead. - [Retrieve a file](https://www.tryleap.ai/docs/api-reference/files/retrieve-a-file.md): A file's details, with a fresh signed link valid for 24 hours. - [Start a video or sound upload](https://www.tryleap.ai/docs/api-reference/files/start-a-video-or-sound-upload.md): The first of three steps for a video or a sound: this answers with a URL. `PUT` the file's bytes there with exactly `upload_headers` within the hour, then complete the upload. Up to 1 GB of video (MP4, MOV, WebM) or 500 MB of audio (MP3, WAV, M4A), and up to 4 hours long. Needs credit on your balanc… - [Complete an upload](https://www.tryleap.ai/docs/api-reference/files/complete-an-upload.md): After the `PUT`, makes the upload a file with the same ID, ready to pass in a model's input. Send a JSON body, even an empty one (`{}`). The file's type and length are read from its bytes. - [Retrieve your balance](https://www.tryleap.ai/docs/api-reference/credits/retrieve-your-balance.md): What your workspace can spend now, and what running generations hold. Add credits at https://app.tryleap.ai/go/settings/credits. ## OpenAPI Specs - [openapi](/docs/openapi.json) ## Optional - [Model catalog](https://www.tryleap.ai/models) - [Connect an agent](https://app.tryleap.ai/go/connect) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.