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

# Pricing and credits

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

You pay per result, in US dollars, from your workspace's balance. There are no plans or seats. A run that fails, or that a model refuses, is never charged.

## Read a price

Every model and preset has a `pricing` object:

```json theme={"theme":"css-variables"}
{
  "unit": "second",
  "usd": "0.11",
  "overrides": [{ "when": { "audio": true }, "usd": "0.165" }],
  "drivers": ["duration", "audio"]
}
```

| Field | Meaning |
| - | - |
| `unit` | What one unit is: `image`, `megapixel`, `second` (of video or audio), `character` (of speech), `output` (a flat price per song, 3D model and the like) or `minute` (of your own recording). |
| `usd` | The price of one unit, as an exact decimal string. |
| `overrides` | Prices that apply when the input has those values. The last one that matches wins. Here, a second with sound costs \$0.165. |
| `drivers` | The input fields that change the price. Refresh a price you show when one of them changes. |
| `length_of` | For a price per second or minute of your own file, such as a recording to transcribe: the file inputs whose length is billed. |
| `length_step` | For a `length_of` price: the length is rounded up to this many seconds, such as a started minute. |

So a 4-second clip from `google/veo-3.1-fast` with sound costs 4 × \$0.165 = \$0.66, and two images from `black-forest-labs/flux-2-pro` cost 2 × \$0.033 = \$0.066.

A key in `when`, like a name in `drivers`, can be a dotted path into a group of settings. `recraft/recraft-v3` costs \$0.044 an image, and \$0.088 with `{ "when": { "settings.style": "vector_illustration" } }`.

`length_of` and `length_step` appear only on prices by the length of your own file. This is `openai/whisper-large-v3`, which bills each started minute of the recording at \$0.0022:

```json theme={"theme":"css-variables"}
{
  "unit": "minute",
  "usd": "0.0022",
  "overrides": [],
  "drivers": ["audio_file", "video"],
  "length_of": ["audio_file", "video"],
  "length_step": 60
}
```

## Get a quote

You don't have to do that sum. `POST /v1/quotes` takes the same body as a generation and returns its price, with the input checked and its defaults filled in. It doesn't run anything or hold any credit.

A quote is optional. A script can start the generation straight away: if the balance doesn't cover it, the request gets a `402` and nothing runs. Use a quote to show a price to a person in your app before they press go, or to check an input without spending.

```bash theme={"theme":"css-variables"}
curl https://api.tryleap.ai/v1/quotes \
  -H "x-api-key: $LEAP_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model": "google/veo-3.1-fast", "input": {"prompt": "A heron lands on a still lake at dawn", "duration": 4}}'
```

```json theme={"theme":"css-variables"}
{
  "object": "quote",
  "model": "google/veo-3.1-fast",
  "revision": "2026-10-02",
  "input": {
    "prompt": "A heron lands on a still lake at dawn",
    "aspect_ratio": "16:9",
    "n": 1,
    "duration": 4,
    "resolution": "1080p",
    "audio": true
  },
  "cost_usd": "0.66",
  "hold_usd": "0.66"
}
```

A quote checks your input against the model's schema, so an input that `POST /v1/generations` would answer with a `400` gets the same `400` here, for free. It can't tell whether the model will accept your prompt: a refusal shows up later, as a failed generation that isn't charged.

A quote doesn't reserve its price, and a run is priced again when it starts. A stable model's price changes only after notice; a preview model's can change at any time. For a model priced by the length of your own file, the final charge is known only when the run ends (see [Holds and charges](#holds-and-charges)).

## Holds and charges

When a run starts, its price is held from your balance. When it ends:

* If it succeeded, you're charged `cost_usd`, and the generation's `usage.cost_usd` shows it.
* If it failed, was refused or was canceled, the hold is released and nothing is charged.

`hold_usd` is usually the same as `cost_usd`. For a model priced by the length of your own file, it can be more: the price of your file's length and a second more, or of the longest file the model takes when your file's exact length isn't known. Such a run is charged when it ends, at the quoted `cost_usd`, or more if the model counted a longer length than your file's.

If your available balance doesn't cover a run's hold, the request gets a `402` with the code `insufficient_credit`, and nothing starts.

## Your balance

```bash theme={"theme":"css-variables"}
curl https://api.tryleap.ai/v1/credits -H "x-api-key: $LEAP_API_KEY"
```

```json theme={"theme":"css-variables"}
{ "object": "credits", "available_usd": "4.67", "held_usd": "0.66" }
```

`available_usd` is what you can spend now: your balance minus the holds of runs still going. `held_usd` is what those runs hold.

Add credits, and turn on auto top-up so a job never stops for an empty balance, at [app.tryleap.ai/go/settings/credits](https://app.tryleap.ai/go/settings/credits).

## Before your first top-up

Two limits apply to a workspace that hasn't added credit yet. Both lift with its first top-up, unless that top-up is refunded.

One run priced by the length of your own video or sound runs at a time. A second one at once gets a `429` with `Retry-After: 60`.

Speech-to-text and captions models, such as `openai/whisper-large-v3`, transcribe up to 120 minutes per UTC day. Each run counts its started minutes, and a run that fails or is canceled gives them back.

| When | Answer |
| - | - |
| One request asks for more than 120 minutes | `402` with the code `insufficient_credit`. Waiting won't help; add credit. |
| Today's 120 minutes are used up | `429` with the code `rate_limit_exceeded`, and `Retry-After` set to the seconds until midnight UTC. |
| The day's count can't be checked for a moment | `503` with the code `service_unavailable`. Try again in a few minutes, or add credit. |


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