Start an upload
curl --request POST \
--url https://api.creatorline.io/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content_type": "image/png",
"size_bytes": 482113,
"filename": "face.png"
}
'import requests
url = "https://api.creatorline.io/v1/uploads"
payload = {
"content_type": "image/png",
"size_bytes": 482113,
"filename": "face.png"
}
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', size_bytes: 482113, filename: 'face.png'})
};
fetch('https://api.creatorline.io/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.creatorline.io/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',
'size_bytes' => 482113,
'filename' => 'face.png'
]),
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.creatorline.io/v1/uploads"
payload := strings.NewReader("{\n \"content_type\": \"image/png\",\n \"size_bytes\": 482113,\n \"filename\": \"face.png\"\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.creatorline.io/v1/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content_type\": \"image/png\",\n \"size_bytes\": 482113,\n \"filename\": \"face.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creatorline.io/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 \"size_bytes\": 482113,\n \"filename\": \"face.png\"\n}"
response = http.request(request)
puts response.read_body{
"object": "upload",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upload_url": "<string>",
"method": "PUT",
"headers": {},
"expires_in": 123,
"complete_url": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "`content_type` is required (e.g. image/png).",
"param": "content_type"
},
"request_id": "req_8fQ2mRxK1pLd"
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Missing or invalid API key."
},
"request_id": "req_8fQ2mRxK1pLd"
}{
"error": {
"type": "permission_error",
"code": "insufficient_scope",
"message": "This API key is read-only. Create a key with the `write` scope to run generations."
},
"request_id": "req_8fQ2mRxK1pLd"
}{
"error": {
"type": "not_found_error",
"code": "resource_missing",
"message": "No such generation."
},
"request_id": "req_8fQ2mRxK1pLd"
}Assets
Start an upload
Uploads are two-step and the bytes never pass through this API:
POST /v1/uploads→ a short-lived presignedPUTand the asset id it will becomePUTthe bytes toupload_urlwith the returned headersPOST /v1/uploads/{id}/complete→ the asset is ready to use as a generation input
Limits: images 25 MB, video 100 MB, audio 50 MB.
POST
/
v1
/
uploads
Start an upload
curl --request POST \
--url https://api.creatorline.io/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content_type": "image/png",
"size_bytes": 482113,
"filename": "face.png"
}
'import requests
url = "https://api.creatorline.io/v1/uploads"
payload = {
"content_type": "image/png",
"size_bytes": 482113,
"filename": "face.png"
}
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', size_bytes: 482113, filename: 'face.png'})
};
fetch('https://api.creatorline.io/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.creatorline.io/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',
'size_bytes' => 482113,
'filename' => 'face.png'
]),
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.creatorline.io/v1/uploads"
payload := strings.NewReader("{\n \"content_type\": \"image/png\",\n \"size_bytes\": 482113,\n \"filename\": \"face.png\"\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.creatorline.io/v1/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content_type\": \"image/png\",\n \"size_bytes\": 482113,\n \"filename\": \"face.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creatorline.io/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 \"size_bytes\": 482113,\n \"filename\": \"face.png\"\n}"
response = http.request(request)
puts response.read_body{
"object": "upload",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upload_url": "<string>",
"method": "PUT",
"headers": {},
"expires_in": 123,
"complete_url": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "`content_type` is required (e.g. image/png).",
"param": "content_type"
},
"request_id": "req_8fQ2mRxK1pLd"
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Missing or invalid API key."
},
"request_id": "req_8fQ2mRxK1pLd"
}{
"error": {
"type": "permission_error",
"code": "insufficient_scope",
"message": "This API key is read-only. Create a key with the `write` scope to run generations."
},
"request_id": "req_8fQ2mRxK1pLd"
}{
"error": {
"type": "not_found_error",
"code": "resource_missing",
"message": "No such generation."
},
"request_id": "req_8fQ2mRxK1pLd"
}Authorizations
bearerAuthapiKeyHeader
Your organization's API key, from Settings → API. Authorization: Bearer crl_sk_live_…
Body
application/json
⌘I