Retrieve a generation
A generation’s status, outputs and cost. Each read signs fresh output links, valid for 24 hours.
To wait for the result, send Prefer: wait=60: the read holds until status is succeeded, failed or canceled, or 60 seconds pass, so a loop of these reads long-polls a video in a few requests. Without it the read answers at once; while the run isn’t final, Retry-After says how many seconds to wait before the next read.
Needs an API key with the generations:read scope.
curl --request GET \
--url https://api.tryleap.ai/v1/generations/{id} \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.tryleap.ai/v1/generations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/generations/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "gen_7Hq2mVx9Lr4Kp8Tn3Wc6Yb1D",
"object": "generation",
"model": "google/veo-3.1-fast",
"modality": "video",
"status": "succeeded",
"provider": "gateway",
"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
},
"output": [
{
"type": "video",
"url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
"expires_at": "2026-10-05T18:24:12.004Z",
"content_type": "video/mp4",
"width": 1920,
"height": 1080,
"poster": {
"url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
"expires_at": "2026-10-05T18:24:12.004Z",
"width": 720,
"height": 405
}
}
],
"error": null,
"usage": {
"cost_usd": "0.66"
},
"source": "api",
"batch_id": null,
"created_at": "2026-10-04T18:22:41.512Z",
"started_at": "2026-10-04T18:22:42.090Z",
"completed_at": "2026-10-04T18:24:11.877Z"
}{
"error": {
"type": "invalid_request_error",
"code": "conflicting_credentials",
"message": "Send one API key.",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}{
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Authentication is required.",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}{
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "Permission denied.",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "That generation does not exist.",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Too Many Requests",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}Authorizations
Your workspace API key, leap_.... Create one at https://app.tryleap.ai/go/api, and keep it on your server.
Headers
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.
"wait=60"
Path Parameters
The generation's ID, gen_....
Response
The generation, as it is now or when the wait ends.
One run of a model or preset, with its status, its outputs and what it cost.
The generation's ID, gen_ and 24 letters and digits.
"generation"The model or preset it runs, with a preset's version.
What it makes: image, video, audio, 3d or text.
image, video, audio, 3d, text queued, then running, then one of succeeded, failed or canceled. Only succeeded is charged.
queued, running, succeeded, failed, canceled Which upstream ran it, once one did. Informational: the model ID and input stay the same whichever runs it.
The model's schema and price revision the run used.
^\d{4}-\d{2}-\d{2}$The input as it runs, with the defaults filled in.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Why a failed run failed, such as a refused prompt or a provider error; null otherwise. A failed run isn't charged.
Show child attributes
Show child attributes
What the run cost your workspace.
Show child attributes
Show child attributes
Where it was started: api, mcp or studio.
studio, api, mcp The batch it belongs to, bat_...; null if none.
When it was created.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$When it started running; null while queued.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$When it reached a final status; null before.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$While a preset that makes a still first is running: that still, once it exists, before the video it becomes. Absent for every other run, and for a run whose video also reads words or a photo you sent, such as a line to say or a photo the clip starts from: that still comes with the video.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.tryleap.ai/v1/generations/{id} \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.tryleap.ai/v1/generations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/generations/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "gen_7Hq2mVx9Lr4Kp8Tn3Wc6Yb1D",
"object": "generation",
"model": "google/veo-3.1-fast",
"modality": "video",
"status": "succeeded",
"provider": "gateway",
"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
},
"output": [
{
"type": "video",
"url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
"expires_at": "2026-10-05T18:24:12.004Z",
"content_type": "video/mp4",
"width": 1920,
"height": 1080,
"poster": {
"url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
"expires_at": "2026-10-05T18:24:12.004Z",
"width": 720,
"height": 405
}
}
],
"error": null,
"usage": {
"cost_usd": "0.66"
},
"source": "api",
"batch_id": null,
"created_at": "2026-10-04T18:22:41.512Z",
"started_at": "2026-10-04T18:22:42.090Z",
"completed_at": "2026-10-04T18:24:11.877Z"
}{
"error": {
"type": "invalid_request_error",
"code": "conflicting_credentials",
"message": "Send one API key.",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}{
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Authentication is required.",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}{
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "Permission denied.",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "That generation does not exist.",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Too Many Requests",
"param": null,
"doc_url": null,
"request_id": "req_8kQ2vX9mR4tL6nB1cW3yZ5aD"
}
}