Skip to main content

File Storage

File Storage​

ZeroDB includes S3-compatible file storage for documents, images, and agent artifacts, scoped per project. Every path below requires your project's ID.

Upload a File​

Uploads are multipart/form-data, not a JSON body — send the file as file, with project_id in the path.

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

Download a File​

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

Generate a Presigned URL​

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

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

For a presigned upload (client PUTs bytes directly to storage, skipping the API body size limit), use POST /files/presign-upload with a multipart/form-data body (file_name, optional content_type/key/expires_in), then confirm with POST /files/confirm-upload.

List Files​

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

Supports skip/limit or page/page_size query params for pagination.

Python SDK​

import requests

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

## Upload a file (multipart, not JSON)
with open("report.pdf", "rb") as f:
response = requests.post(
f"{base}/{project_id}/files/upload",
headers=headers,
files={"file": ("report.pdf", f, "application/pdf")},
)
file_id = response.json()["file_id"]

## Generate a presigned URL for sharing
url_resp = requests.post(
f"{base}/{project_id}/files/{file_id}/presigned-url",
headers=headers,
)
print(url_resp.json()["url"]) # Temporary download link
💡Use Cases

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

Endpoints​

All paths below are relative to /api/v1/public/zerodb/{project_id}.

MethodPathDescription
POST/files/uploadUpload a file (multipart)
GET/filesList files
GET/files/{file_id}Download a file
DELETE/files/{file_id}Delete a file
POST/files/{file_id}/presigned-urlGenerate a presigned download URL
POST/files/presign-uploadGet a presigned direct-upload URL (large files)
POST/files/confirm-uploadConfirm a presigned upload completed
API key scoping

A project-scoped API key is restricted to its own project — using it against a different project_id in the path returns 403.

Storage Limits​

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