Start a video or sound upload
The first of three steps for a video or a sound: this answers with a URL. PUT the file’s bytes there with exactly upload_headers within the hour, then complete the upload. Up to 1 GB of video (MP4, MOV, WebM) or 500 MB of audio (MP3, WAV, M4A), and up to 4 hours long. Needs credit on your balance. A workspace can upload 5 GB a day, with 10 uploads in flight at once.
Needs an API key with the generations:write scope.
curl --request POST \
--url https://api.tryleap.ai/v1/uploads \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"bytes": 123
}'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({bytes: 123})
};
fetch('https://api.tryleap.ai/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/uploads"
payload = { "bytes": 123 }
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 file's type: MP4, MOV or WebM video; MP3, WAV or M4A audio.
video/mp4, video/quicktime, video/webm, audio/mpeg, audio/mp3, audio/wav, audio/x-wav, audio/wave, audio/mp4, audio/x-m4a The file's exact size in bytes.
x <= 1073741824A name to keep with the file, such as interview.mp4.
1 - 200Response
Where and how to send the bytes.
Where to send a video's or a sound's bytes before you complete the upload.
The upload's ID, file_.... Completing it makes a file with the same ID.
"upload"The type you declared.
The size you declared, in bytes.
x <= 9007199254740991The name you gave, if any.
Where to send the file's bytes.
The method to send them with.
"PUT"Headers to send with the bytes, exactly as given.
Show child attributes
Show child attributes
When upload_url stops working, an hour after it was made.
^(?:(?:\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 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"bytes": 123
}'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({bytes: 123})
};
fetch('https://api.tryleap.ai/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tryleap.ai/v1/uploads"
payload = { "bytes": 123 }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)