Start an image upload
curl --request POST \
--url https://api.solaraai.com/api/v1/manual-posts/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "photo",
"content_type": "image/jpeg",
"size_bytes": 482113
}
'import requests
url = "https://api.solaraai.com/api/v1/manual-posts/uploads"
payload = {
"kind": "photo",
"content_type": "image/jpeg",
"size_bytes": 482113
}
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({kind: 'photo', content_type: 'image/jpeg', size_bytes: 482113})
};
fetch('https://api.solaraai.com/api/v1/manual-posts/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"expires_at": "2023-11-07T05:31:56Z",
"part_size": 123,
"parts": [
{
"part_number": 123,
"url": "<string>"
}
],
"total_parts": 123,
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"video_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upload_link": "<string>"
}{
"code": "invalid_credentials",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Posting
Start an image upload
Solara AI API: Opens a multipart upload for an image the person wants posted: kind photo, a JPEG, PNG or WebP of at most 20 MB. PUT each part to its presigned URL with no Authorization header, keep each response’s ETag, then complete it.
Permission: Edit (edit).
POST
/
api
/
v1
/
manual-posts
/
uploads
Start an image upload
curl --request POST \
--url https://api.solaraai.com/api/v1/manual-posts/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "photo",
"content_type": "image/jpeg",
"size_bytes": 482113
}
'import requests
url = "https://api.solaraai.com/api/v1/manual-posts/uploads"
payload = {
"kind": "photo",
"content_type": "image/jpeg",
"size_bytes": 482113
}
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({kind: 'photo', content_type: 'image/jpeg', size_bytes: 482113})
};
fetch('https://api.solaraai.com/api/v1/manual-posts/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"expires_at": "2023-11-07T05:31:56Z",
"part_size": 123,
"parts": [
{
"part_number": 123,
"url": "<string>"
}
],
"total_parts": 123,
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"video_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upload_link": "<string>"
}{
"code": "invalid_credentials",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Authorizations
Body
application/json
parts: one presigned PUT per part_size part, completed with each part's ETag. link, for an AI agent's image (an API key or a connected app; 403 agent_only otherwise): no part URLs, one short upload_link instead, for 2 hours. A GET of it answers the file's presigned PUT as text, so a shell sends the file with: curl -fsS -T "FILE" "$(curl -fsS '<upload_link>')". Then complete-manual-post-upload with no parts
Available options:
parts, link Response
Created