---
title: "File Storage"
description: "S3-compatible object storage for documents, images, and agent artifacts"
canonical: "https://docs.ainative.studio/docs/zerodb/files"
last-updated: "2026-10-03T21:47:10.764Z"
---

# File Storage

Source: https://docs.ainative.studio/docs/zerodb/files

> S3-compatible object storage for documents, images, and agent artifacts

## File Storage

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

## Upload a File

```bash
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

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

## Generate a Presigned URL

```bash
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

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

## Python SDK

```python
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

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file_name` | `string` | Yes | Name of the file |
| `file_content` | `string` | Yes | Base64-encoded file content |
| `content_type` | `string` | No | MIME type (auto-detected if omitted) |
| `folder` | `string` | No | Virtual folder path |
| `metadata` | `object` | No | Custom metadata tags |

<Callout type="tip" title="Use Cases">
Document storage for RAG pipelines, image/artifact storage for agents, agent-generated file persistence, and report archival.
</Callout>

## Endpoints

| Method | Path | Description |
|--------|------|-------------|
| POST | `/zerodb/files` | Upload a file |
| GET | `/zerodb/files` | List files |
| GET | `/zerodb/files/{id}` | Download a file |
| POST | `/zerodb/files/{id}/url` | Generate presigned URL |
| DELETE | `/zerodb/files/{id}` | Delete a file |

## Storage Limits

| Tier | Object Storage | File Size Limit |
|------|---------------|----------------|
| Free | 1 GB | 50 MB |
| Pro | 10 GB | 100 MB |
| Business | 50 GB | 500 MB |
| Enterprise | 100 GB | 1 GB |
