---
title: "Create a quote"
method: POST
path: "/v1/quotes"
tags: ["Quotes"]
---

# Create a quote

`POST /v1/quotes`

## Request

- Base URL: `https://api.tryleap.ai`
- URL: `https://api.tryleap.ai/v1/quotes`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

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.

Needs an API key with the `generations:read` scope.

## Request body

- GenerationRequest
  - `model` string, required: The model or preset to run, such as `black-forest-labs/flux-2-pro` or `leap/restore-photo@1`. A preset ID without `@N` runs its latest version.
  - `input` object: The model's input, as its `input_schema` from `GET /v1/models/{creator}/{name}` describes it. Fields you leave out take their defaults; unknown fields are refused. Files are `file_...` IDs.
  - `webhook` string, uri: An https URL to POST the generation.succeeded, generation.failed or generation.canceled event to when the run ends, signed with your workspace's default secret (GET /v1/webhooks/default/secret).

## Response `200`

The price and the input as it would run.

- Quote: What a run would cost, without running it or holding credit.
  - `object` 'quote', required
  - `model` string, required: The model or preset priced, with a preset's version.
  - `revision` string, required: The model's schema and price revision the price comes from.
  - `input` object, required: The input as it would run, checked and with its defaults filled in.
  - `cost_usd` string, required: What the run would cost, as an exact decimal string in US dollars.
  - `hold_usd` string, required: What the run holds from your balance until it ends. For a model billed by the length of your video or sound, the price of that length plus a second, or of the longest file the model takes when the length can't be read; you're charged only the run's price.

## Other responses

- `400`: `invalid_parameter`, `conflicting_credentials`
- `401`: `authentication_required`
- `403`: `permission_denied`
- `410`: `gone`
- `429`: `rate_limit_exceeded`
- `503`: `service_unavailable`

---

[API](https://skmtc.dev/tryleap/apis/leap-api.md) · [All operations](https://skmtc.dev/tryleap/apis/leap-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tryleap/apis/leap-api/revisions/c01f98d3e835?raw)
