Create a generation
Starts a run of any model or preset. Every model takes this same shape; only input differs, as the model's input_schema says. The price is held from your balance first, and charged only if the run succeeds.
Without Prefer, the answer comes at once with the generation queued. With Prefer: wait=60, it comes when the run finishes or after 60 seconds, whichever is first: most images finish inside the wait, and video doesn't. Send an Idempotency-Key so a retry never starts a second run.
A run that would sexualise a real person from a photo you uploaded is refused with 422 sexualized_real_person before anything is held: words that ask to undress them or show them in a sexual way, on the photo or on an image Leap made from it, or a face swap or a recast into a sexual picture or clip.
Needs an API key with the generations:write scope.
Request
- Base URL: https://api.tryleap.ai
- URL: https://api.tryleap.ai/v1/generations
- Auth: one of:
- API key in header x-api-key
- HTTP bearer
Headers
A key you generate for this request, such as a UUID, so a retry never starts a second run. A retry with the same key and body returns the same generation as it is now, marked Idempotent-Replayed: true. The same key with a different body is a 409. A key belongs to your workspace and doesn't expire, so use a new one for each new request.
wait=N holds the request open for up to N seconds (at most 60) until the generation finishes, and Preference-Applied echoes the wait used. Most images finish inside the wait. If the run is still going when it ends, you get it back queued or running; poll it from there. Without this header the generation comes back queued at once.
Request body
Response
The generation: queued at once, or as it is when the wait ends.
Changes
No recorded changes to this operation across all 1 revision of this API.