> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerodrive.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Hosted remote MCP endpoint: https://api.zerodrive.dev/mcp (OAuth 2.0 PKCE or Bearer token).
> REST API base URL: https://api.zerodrive.dev with OpenAPI 3.1.0 specification at https://api.zerodrive.dev/openapi.json.
> S3-compatible gateway: https://api.zerodrive.dev/s3 (AWS Signature V4, region auto).
> Local command-line tool: zd (or zerodrive) and local stdio MCP server: zerodrive mcp.
> Token prefixes: zdk_ (Personal API Key), zdt_ (device session token), zda_ (OAuth access token), zdr_ (OAuth refresh token), zdx_ (temporary sandbox key). Never paste real keys into prompts or code.
> Be honest about platform boundaries: cloud files require internet access, files are encrypted at rest and in transit by Cloudflare rather than end-to-end encrypted, ZeroDrive is not a replacement for an independent backup, Windows 11 support is an unsigned x64 beta, and the 7-day Pro free trial requires a card and charges automatically when it ends.

# App Storage & Architecture

> Using ZeroDrive as storage for apps and webapps: what works today, how it compares to Supabase and CDNs, video streaming, limits, and roadmap.

ZeroDrive lets users **Bring Your Own Storage (BYOS)** to third-party apps, webapps, and AI tools. Instead of your app paying for user storage or trapping files inside a single app silo, users connect their ZeroDrive account via OAuth 2.0 and keep every file live in Finder, Windows Explorer, the Web App, and MCP.

## What works today vs. what's on the roadmap

| Capability | Status | Details |
| :- | :- | :- |
| **OAuth 2.0 + PKCE + Dynamic Registration** | **Live** | `/oauth/authorize`, `/oauth/token`, `/oauth/revoke`, `/oauth/register` (RFC 7591), and Device Flow (`/oauth/device/*`) with rotating refresh tokens (`zdr_`). |
| **Developer OAuth apps & API keys** | **Live** | Manage confidential OAuth apps (`zd_app_*`) and scoped Personal API Keys (`zdk_*`) in the Web App (`#connect`), with optional `root_folder` and `allowed_drives` sandboxes. |
| **Direct uploads, range downloads & S3** | **Live** | Direct-to-R2 presigned `PUT` URLs (`/v1/files/upload-urls`, `/v1/uploads/prepare`) and multipart up to 5 TiB across 45 MB parts, signed byte-range downloads (`/v1/files/download-url`), S3 gateway (`/s3`), SSE events (`/v1/events`), OpenAPI 3.1, and open CORS (`ETag` exposed). |
| **Structured JSON / CSV / MD / YAML edits** | **Live** | `/v1/primitives/*` lets apps query, patch, append JSONL, and 3-way merge structured files without downloading and re-uploading whole files. |
| **1-click `app_folder` OAuth scope** | **Live** | Auto-creates `_APPS/<AppName>`, locks `zda_`/`zdr_` tokens to `root_folder = "_APPS/<AppName>"`, includes a default-ON AI access toggle (`ai_access_enabled`), reuses valid `app.zerodrive.dev` sessions, and supports inline starter signup (capped at 3 active free accounts per hashed IP). |
| **Single-Workspace / Small-Team SQL (`AppDatabase`)** | **Live** | Isolated per-workspace, per-app SQLite via Cloudflare Durable Objects (`/v1/apps/:slug/sql`, `/v1/apps/:slug/schema`, `/v1/apps`) for up to \~20 users per workspace, plus read-only MCP bridge (`list_app_databases`, `query_app_database`) when `ai_access_enabled = 1`. 50k+ cross-customer shared SaaS SQL still belongs in Postgres/Supabase/Firestore. |
| **Change cursor (`GET /v1/changes`) & Webhooks** | **Live** | Durable change log cursor (`GET /v1/changes?cursor=...`, scoped to `root_folder`) and signed webhooks (`POST/GET/DELETE /v1/webhooks`, `POST /v1/webhooks/:id/test`, `X-ZeroDrive-Signature` HMAC with 3-attempt backoff and 10-failure auto-disable). |
| **Folder-scoped S3 credentials via OAuth** | **Live** | `POST/GET/DELETE /v1/oauth/s3-credentials` mints `zdsk_*` S3 keypairs permanently locked to the OAuth token's `root_folder`, cascade-revoked when the app is revoked. |
| **Edge-verified read tokens (`zde_`) & orphan cleanup** | **Live** | `POST /v1/auth/edge-read-token` mints short-lived HMAC-signed `zde_` tokens verified at the edge with zero D1 round-trips on read/streaming routes; scheduled cron cleans expired upload sessions, staging blobs, and stale quota reservations. |
| **`llms.txt` quickstart** | **Live** | Public plain-text AI coding-agent quickstart at `GET https://api.zerodrive.dev/llms.txt`. |
| **TypeScript/Python SDKs & UI Widget (`@7xsystems/zerodrive-sdk`, `zerodrive`, `@7xsystems/zerodrive-widget`)** | **TypeScript SDK and widget live on npm; Python pending PyPI publish** | `@7xsystems/zerodrive-sdk@0.2.0` (`ZeroDrive.connect()`, `zd.upload()`, `zd.sql()`, `zd.changes()`, `zd.webhooks`, `zd.s3`, Next.js / Supabase / Auth.js / Firebase adapters), Python `zerodrive==0.2.0`, and `@7xsystems/zerodrive-widget@0.1.0` (`<ConnectZeroDrive />`, `<ZeroDrivePicker />`, `507`/`403` upgrade modal). |
| **Automatic 4K/ProRes proxy & HLS transcoding** | **Planned (v2)** | Background 1080p/HLS proxy generation so raw camera uploads scrub smoothly in browsers and low-bandwidth clients. |
| **Optional opt-in public CDN mode** | **Planned (v2)** | Unauthenticated edge-cached delivery for published public media assets, strictly isolated from private vaults. |
| **Next-gen `FSKit` / predictive block streaming** | **Planned (v2)** | Predictive block-level read-ahead and write-back caching tuned for multi-track 4K NLE timelines. |

> [!NOTE]
>
> Third-party OAuth apps requesting `app_folder` now get a 1-click consent card with automatic `_APPS/<AppName>` sandboxing, default-ON AI access (`ai_access_enabled`), isolated `AppDatabase` SQL, durable `/v1/changes`, webhooks, and folder-scoped S3 credentials. The updated `@7xsystems/zerodrive-sdk`, `zerodrive`, and `@7xsystems/zerodrive-widget` packages are verified in-repo and ready for npm/PyPI publishing.

## ZeroDrive vs. Firebase / Supabase vs. S3 vs. CDN

Apps normally split backend work across three layers—a **relational/document database**, **object/file storage**, and a **public edge CDN**:

| Service | Best job | What ZeroDrive replaces | What ZeroDrive does not replace |
| :- | :- | :- | :- |
| **Firebase (Auth + Firestore) / Supabase (Postgres + Auth)** | Fast multi-user shared SaaS databases (50k+ cross-customer accounts, cross-user joins, row locks, auth, comments, billing state). | **Single-Workspace / Small-Team SQL (up to \~20 users per workspace)** via `AppDatabase` (`/v1/apps/:slug/sql`) plus structured `.json`/`.jsonl`/`.csv`/`.md`/`.yaml` (`/v1/primitives/*`). | 50k+ cross-customer shared SaaS SQL tables with cross-account queries or transactions. |
| **Firebase Storage / Supabase Storage / S3 / R2** | Storing user files (video, audio, PDFs, exports, images) in developer-owned buckets. | **Direct replacement** with user-owned BYOS storage—your app pays \$0 for storage/egress and files remain accessible in Finder, Explorer, and MCP. | Internal static buckets owned solely by your company. |
| **Public CDN** | Caching unauthenticated public images/videos globally for tens of thousands of anonymous visitors. | Authenticated HTTP Byte-Range streaming (`206 Partial Content`) on `/vault/download` and `/s3/*`, plus private/link web shares. | High-traffic public website caching or server-side video transcoding. |

### Two recommended app architectures

1. **Pattern A — ZeroDrive-only backend (Single-Workspace / Small-Team, creator, local-first, or AI apps):** Users click **Connect ZeroDrive**, and your app stores both large media files and **Single-Workspace / Small-Team SQL (up to \~20 users per workspace)** (`AppDatabase` DO SQLite) or structured primitives inside `_APPS/<AppName>`. Zero database or storage hosting bill for you.
2. **Pattern B — Hybrid Firebase (Auth + Firestore) or Supabase (Postgres + Auth) + ZeroDrive (Multi-User SaaS):** Use **Firebase (Auth + Firestore)** or **Supabase (Postgres + Auth)** for 50k+ cross-customer shared SaaS data (accounts, teams, billing, comments, and ZeroDrive file paths/`item_id`s), and store all heavy user files in **ZeroDrive** instead of Firebase Storage, S3, or Supabase Storage. Stay synced with Finder/Explorer edits via `GET /v1/changes?cursor=...` or webhooks.

## Video & 4K streaming (and whether you need a CDN)

* **What works today:** `/s3/*`, `/vault/download`, and ZeroDrive's desktop drives support **HTTP Byte-Range (`Range` / `206 Partial Content`) streaming** backed by Cloudflare R2 (\$0 egress). Video players, browsers, and editors can jump to any timestamp in compressed **4K MP4 / H.264 / H.265** files without downloading the full file first.
* **What ZeroDrive does not do today:** Unlike specialized post-production platforms (such as Shade or LucidLink), ZeroDrive does **not** automatically transcode raw camera formats (ProRes/RAW) into 1080p/HLS browser proxies, and does not run a custom multi-editor cinema block filesystem.
* **Do you need a CDN?** For private user or team playback, **no**—Cloudflare Workers + R2 already stream globally with zero egress. If your app needs smooth browser playback of raw camera uploads, add a **transcoding/HLS layer** (such as Cloudflare Stream or an FFmpeg proxy pipeline), not just a caching CDN. Add a public CDN only for high-traffic unauthenticated public websites.

## Limits & design boundaries

Design your integration around these real platform constraints:

* **Large uploads (`> 45 MB` / `> 100 MB`):** Single `PUT` calls through the Worker are bounded by Cloudflare's \~100 MB request body limit, so use `zd.upload()` (automatic 45 MB multipart chunking over `/v1/files/multipart/*` up to 5 TiB) or direct-to-R2 presigned `PUT`s via `/v1/files/upload-urls` (up to 5 GiB single `PUT`).
* **Auth latency vs. edge reads:** Standard API calls validate tokens and plan status against D1; use `POST /v1/auth/edge-read-token` (`zde_`, 180s default / 300s max TTL) for `<1 ms` edge verification on read/streaming GET routes.
* **User-owned quota & plan state:** Always handle `507 quota_exceeded` and `403 read_only` cleanly in your UI when a user's drive is full or in a post-cancel read-only window.
* **Encryption & offline behavior:** Standard cloud encryption (HTTPS in transit and AES-256 at rest managed by Cloudflare) is the **default** so AI tools, MCP, Knowledge Brain search, and web previews work out of the box. Client-side zero-knowledge encryption is strictly an optional app-level pattern for ultra-private folders (note: server-side Knowledge Brain cannot index client-encrypted blobs). Cloud-only files require internet access unless cached locally.

See [Error Codes, Refusals & Limits](https://docs.zerodrive.dev/api-reference/errors-and-limits.md) for exact route caps (`POST /v1/files/move`, `batch`, `read-bytes`/`write-bytes`).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.