> ## Documentation Index
> Fetch the complete documentation index at: https://www.tryleap.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## 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

> Generate images, video and audio with Veo, Kling, Seedance, FLUX, GPT Image, ElevenLabs and more, through one REST API and one balance.

Leap runs the best image, video and audio models behind one request shape. Pick a model, send its input, get back a file. You pay from one balance, you can price any run before you start it, and a run that fails is never charged.

Besides raw models, the catalog has presets: ready-made recipes such as `leap/restore-photo@1` or `leap/headshot@1` that pair a model with an expert prompt. You call a preset exactly like a model.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/docs/quickstart">
    Create a key and get your first image in one request.
  </Card>

  <Card title="Generations" icon="play" href="/docs/generations">
    Start a run, then wait for it, long-poll it or get a webhook.
  </Card>

  <Card title="Models and schemas" icon="list" href="/docs/models">
    Find a model and read the JSON Schema of its input.
  </Card>

  <Card title="Use it from your agent" icon="bot" href="/docs/agents">
    Install the Leap skill, or connect over MCP.
  </Card>
</CardGroup>

## How a request works

1. Find a model. `GET /v1/models` lists every model and preset with its price. `GET /v1/models/{creator}/{name}` returns one with its `input_schema`, the JSON Schema of the input it takes.
2. Start a run: send `POST /v1/generations` with `{"model": "...", "input": {...}}`.
3. Get the result. Add `prefer: wait=60` to get an image back in the same request. For video, long-poll `GET /v1/generations/{id}` with the same header, or name a `webhook` URL and Leap calls you. Each output is a signed link to the file.

```bash theme={"theme":"css-variables"}
curl https://api.tryleap.ai/v1/generations \
  -H "x-api-key: $LEAP_API_KEY" \
  -H "content-type: application/json" \
  -H "prefer: wait=60" \
  -d '{"model": "black-forest-labs/flux-2-pro", "input": {"prompt": "A red bicycle against a yellow wall"}}'
```

## At a glance

| | |
| - | - |
| Base URL | `https://api.tryleap.ai` |
| Authentication | Your key in the `x-api-key` header, or as `Authorization: Bearer`. See [Authentication](/docs/authentication). |
| Format | JSON in and out, with `snake_case` fields. An image upload takes the raw file as its body. |
| IDs | A prefix and 24 letters and digits: `gen_` for a generation, `file_` for a file, `bat_` for a batch. |
| Money | US dollars as exact decimal strings, such as `"0.033"`. See [Pricing and credits](/docs/pricing). |
| Times | ISO 8601 in UTC, such as `2026-10-04T18:22:41.512Z`. |
| Lists | Paginated lists, such as `GET /v1/generations`, come newest first, 50 rows a page by default, with `next_cursor` for the next page. The model catalog comes whole, without pages. |
| Output links | Signed and valid for 24 hours. Reading the generation again signs fresh ones. |
| Errors | One JSON shape with a stable `type` and `code`. See [Errors and retries](/docs/errors). |
| Reference | Every endpoint, with its parameters, responses and errors, in the [API reference](/docs/api-reference/introduction). It's built from the API's own code, and the raw OpenAPI 3.1 file is at [/docs/openapi.json](https://www.tryleap.ai/docs/openapi.json). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.