curl --request POST \
--url https://api.ekly.ai/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content_type": "image/png",
"filename": "reference.png",
"size_bytes": 482133
}
'import requests
url = "https://api.ekly.ai/v1/uploads"
payload = {
"content_type": "image/png",
"filename": "reference.png",
"size_bytes": 482133
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content_type: 'image/png', filename: 'reference.png', size_bytes: 482133})
};
fetch('https://api.ekly.ai/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ekly.ai/v1/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content_type' => 'image/png',
'filename' => 'reference.png',
'size_bytes' => 482133
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ekly.ai/v1/uploads"
payload := strings.NewReader("{\n \"content_type\": \"image/png\",\n \"filename\": \"reference.png\",\n \"size_bytes\": 482133\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ekly.ai/v1/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content_type\": \"image/png\",\n \"filename\": \"reference.png\",\n \"size_bytes\": 482133\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ekly.ai/v1/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content_type\": \"image/png\",\n \"filename\": \"reference.png\",\n \"size_bytes\": 482133\n}"
response = http.request(request)
puts response.read_body{
"asset_id": "<string>",
"required_headers": {},
"upload_url": "<string>",
"url": "<string>"
}{
"error": {
"code": "unauthenticated",
"message": "This API key is not valid. Create a new one in Settings → Team.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "forbidden",
"message": "API keys can only call the /v1 API.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "validation_error",
"details": [
{
"loc": [
"body",
"model"
],
"msg": "Field required",
"type": "missing"
}
],
"message": "Request validation failed.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded; retry after 12s.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}Create an upload
Registers a reference file and returns a signed URL for its bytes. PUT the file to upload_url with exactly the required_headers; the declared size_bytes is signed into the URL, so a PUT of a different size is rejected. Then pass asset_id in a generation request (for example as reference_images or first_frame). The upload URL is valid for ten minutes; the asset appears in the workspace library like any other upload.
curl --request POST \
--url https://api.ekly.ai/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content_type": "image/png",
"filename": "reference.png",
"size_bytes": 482133
}
'import requests
url = "https://api.ekly.ai/v1/uploads"
payload = {
"content_type": "image/png",
"filename": "reference.png",
"size_bytes": 482133
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content_type: 'image/png', filename: 'reference.png', size_bytes: 482133})
};
fetch('https://api.ekly.ai/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ekly.ai/v1/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content_type' => 'image/png',
'filename' => 'reference.png',
'size_bytes' => 482133
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ekly.ai/v1/uploads"
payload := strings.NewReader("{\n \"content_type\": \"image/png\",\n \"filename\": \"reference.png\",\n \"size_bytes\": 482133\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ekly.ai/v1/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content_type\": \"image/png\",\n \"filename\": \"reference.png\",\n \"size_bytes\": 482133\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ekly.ai/v1/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content_type\": \"image/png\",\n \"filename\": \"reference.png\",\n \"size_bytes\": 482133\n}"
response = http.request(request)
puts response.read_body{
"asset_id": "<string>",
"required_headers": {},
"upload_url": "<string>",
"url": "<string>"
}{
"error": {
"code": "unauthenticated",
"message": "This API key is not valid. Create a new one in Settings → Team.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "forbidden",
"message": "API keys can only call the /v1 API.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "validation_error",
"details": [
{
"loc": [
"body",
"model"
],
"msg": "Field required",
"type": "missing"
}
],
"message": "Request validation failed.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded; retry after 12s.",
"trace_id": "c3746d5302dc4be6b2e8fa99fa762a8c"
}
}Authorizations
An organization API key created in Settings → Team, sent as Authorization: Bearer <key>.
Body
Response
Successful Response
Use this as a reference input (for example reference_images or first_frame) once the PUT has completed.
Show child attributes
Show child attributes
PUT the file bytes here with exactly the listed headers.
Where the file will live after the PUT. Informational; generation inputs take asset_id.