Skip to main content

File Storage

ZeroDB includes S3-compatible file storage for documents, images, and agent artifacts.

Upload a File

curl -X POST https://api.ainative.studio/api/v1/public/zerodb/files \
-H "Authorization: Bearer $TOKEN" \
-F "file=@document.pdf" \
-F "metadata={\"category\": \"reports\"}"

Download a File

curl https://api.ainative.studio/api/v1/public/zerodb/files/{file_id} \
-H "Authorization: Bearer $TOKEN" \
-o downloaded_file.pdf

Generate a Presigned URL

curl https://api.ainative.studio/api/v1/public/zerodb/files/{file_id}/url \
-H "Authorization: Bearer $TOKEN"

Returns a time-limited URL for direct access without auth headers.

List Files

curl https://api.ainative.studio/api/v1/public/zerodb/files \
-H "Authorization: Bearer $TOKEN"

Python SDK

import base64
import requests

headers = {"Authorization": "Bearer YOUR_API_KEY"}
base = "https://api.ainative.studio/api/v1/public/zerodb"

# Upload a file
with open("report.pdf", "rb") as f:
content = base64.b64encode(f.read()).decode()

response = requests.post(f"{base}/files", headers=headers, json={
"file_name": "report.pdf",
"file_content": content,
"content_type": "application/pdf",
"folder": "reports/2026",
"metadata": {"author": "agent-001"}
})
file_id = response.json()["file_id"]

# Generate presigned URL for sharing
url_resp = requests.post(f"{base}/files/{file_id}/url", headers=headers, json={
"operation": "download",
"expiration_seconds": 3600
})
print(url_resp.json()["url"]) # Temporary download link

Upload Parameters

ParameterTypeRequiredDescription
file_namestringYesName of the file
file_contentstringYesBase64-encoded file content
content_typestringNoMIME type (auto-detected if omitted)
folderstringNoVirtual folder path
metadataobjectNoCustom metadata tags
💡Use Cases

Document storage for RAG pipelines, image/artifact storage for agents, agent-generated file persistence, and report archival.

Endpoints

MethodPathDescription
POST/zerodb/filesUpload a file
GET/zerodb/filesList files
GET/zerodb/files/{id}Download a file
POST/zerodb/files/{id}/urlGenerate presigned URL
DELETE/zerodb/files/{id}Delete a file

Storage Limits

TierObject StorageFile Size Limit
Free1 GB50 MB
Pro10 GB100 MB
Business50 GB500 MB
Enterprise100 GB1 GB