Generations
Keep an output as a file
Turns an image output of a succeeded generation into a file of your workspace, so you can pass its ID to the next run without downloading and uploading it. Calling it again returns the same file. Other outputs answer 400.
Needs an API key with the generations:write scope.
POST
https://api.tryleap.ai
/
v1
/
generations
/
{id}
/
outputs
/
{index}
/
file
Keep an output as a file
curl --request POST \
--url https://api.tryleap.ai/v1/generations/{id}/outputs/{index}/file \
--header 'x-api-key: <api-key>'const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.tryleap.ai/v1/generations/{id}/outputs/{index}/file', 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}/outputs/{index}/file"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "file_6Wn1Tc8Lr3Vx5Kq9Bd2Mh7Pz",
"object": "file",
"content_type": "image/jpeg",
"bytes": 412337,
"width": 896,
"height": 1152,
"duration": null,
"filename": null,
"url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
"created_at": "2026-10-04T18:23:02.115Z"
}
Authorizations
ApiKeyBearer
Your workspace API key, leap_.... Create one at https://app.tryleap.ai/go/api, and keep it on your server.
Path Parameters
Response
The file.
A photo, video or sound stored in your workspace, to pass as a model input.
When it was stored.
Pattern:
^(?:(?:\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))$⌘I
Keep an output as a file
curl --request POST \
--url https://api.tryleap.ai/v1/generations/{id}/outputs/{index}/file \
--header 'x-api-key: <api-key>'const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.tryleap.ai/v1/generations/{id}/outputs/{index}/file', 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}/outputs/{index}/file"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "file_6Wn1Tc8Lr3Vx5Kq9Bd2Mh7Pz",
"object": "file",
"content_type": "image/jpeg",
"bytes": 412337,
"width": 896,
"height": 1152,
"duration": null,
"filename": null,
"url": "https://api.tryleap.ai/files/eyJrIjoibWVkaWEvb3V0cHV0cy9nZW5fN0hxMm1WeDlMcjRLcDhUbjNXYzZZYjFEIn0",
"created_at": "2026-10-04T18:23:02.115Z"
}