Quotes

Create a quote

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.

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

Request body

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

inputobject

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.

webhookstring 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

The price and the input as it would run.

object'quote' required
modelstring required

The model or preset priced, with a preset's version.

revisionstring required

The model's schema and price revision the price comes from.

inputobject required

The input as it would run, checked and with its defaults filled in.

cost_usdstring required

What the run would cost, as an exact decimal string in US dollars.

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

Changes

No recorded changes to this operation across all 1 revision of this API.