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.
curl --request POST \
--url https://api.tryleap.ai/v1/quotes \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>'})
};
fetch('https://api.tryleap.ai/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/quotes"
payload = { "model": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
Your workspace API key, leap_.... Create one at https://app.tryleap.ai/go/api, and keep it on your server.
Body
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.
100^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$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.
Show child attributes
Show child attributes
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).
2048Response
The price and the input as it would run.
What a run would cost, without running it or holding credit.
"quote"The model or preset priced, with a preset's version.
100^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9.-]*(@[1-9][0-9]{0,3})?$The model's schema and price revision the price comes from.
^\d{4}-\d{2}-\d{2}$The input as it would run, checked and with its defaults filled in.
Show child attributes
Show child attributes
What the run would cost, as an exact decimal string in US dollars.
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.
curl --request POST \
--url https://api.tryleap.ai/v1/quotes \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>'})
};
fetch('https://api.tryleap.ai/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/quotes"
payload = { "model": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)