Complete an upload
After the PUT, makes the upload a file with the same ID, ready to pass in a model’s input. Send a JSON body, even an empty one ({}). The file’s type and length are read from its bytes.
Needs an API key with the generations:write scope.
curl --request POST \
--url https://api.tryleap.ai/v1/uploads/{id}/complete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"filename": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>'})
};
fetch('https://api.tryleap.ai/v1/uploads/{id}/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/uploads/{id}/complete"
payload = { "filename": "<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.
Path Parameters
The upload's ID, file_....
Body
1 - 200Response
The stored file.
A photo, video or sound stored in your workspace, to pass as a model input.
The file's ID, file_.... Pass it in a model's input.
"file"The type, read from the file's bytes, such as image/jpeg or video/mp4.
The size in bytes.
0 <= x <= 9007199254740991Width in pixels; null for a sound.
0 < x <= 9007199254740991Height in pixels; null for a sound.
0 < x <= 9007199254740991A video's or a sound's length in seconds; null for an image.
x >= 0The name you gave, if any.
A signed link to the file, valid for 24 hours. Read the file again for a fresh one.
When it was stored.
^(?:(?:\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))$curl --request POST \
--url https://api.tryleap.ai/v1/uploads/{id}/complete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"filename": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>'})
};
fetch('https://api.tryleap.ai/v1/uploads/{id}/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/uploads/{id}/complete"
payload = { "filename": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)