Run StitchDB as the backend of your own customers' apps: provision a project per customer, app, tenant or AI-agent task through the API, cap and meter each one, and bill your customers yourself.
Platforms such as AI app builders, AI agent platforms and SaaS products with a database per tenant use StitchDB as the backend for their customers. Each end customer (or app, tenant, agent task) gets its own project: a dedicated Postgres database with Auth, REST API, Storage, Realtime and Edge Functions. You provision it, set its limits and read its usage through the API; your customers never need a StitchDB account, and you bill them yourself.
Quickstart
An organization token, a project, its keys: three calls.
Provisioning
Idempotent creation, templates, TTL, bulk, regions.
Limits per customer
Caps below your plan: size, requests, end users, functions.
Usage and billing
Daily metering per project, CSV export.
Webhooks
Signed events for every project change.
Claim flow
Hand a project over to your customer’s own account.
#Use cases
| You are | You provision | Typically |
|---|---|---|
| An AI app builder | A project per generated app | Template schema from the app, per-app caps, usage per customer for your own pricing, claim link when the customer takes the app over. |
| An AI agent platform | A project per agent, user, task or session | Created on the fly through MCP or the API, ttl_seconds to delete it automatically, a short-lived token limited to that one project (read-only if you like). |
| A SaaS with a database per tenant | A project per tenant | Labels with your tenant id, the same migrations for every tenant, isolation by design (separate databases, keys and roles), per-tenant limits and metering. |
#What you get
| Need | StitchDB |
|---|---|
| Credentials not tied to a person | Organization tokens with scopes, project restriction, IP allowlist, expiry and their own rate limit (up to 200 requests/s). |
| Credentials for an agent or a task | Short-lived project tokens minted from an organization token: one project, a subset of its scopes, at most 24 hours. |
| Create projects from your backend | POST /projects returns in about a second (its DNS name already exists); the project is usually active in 5-15 s (several at once: each in about 15-35 s). Idempotency-Key makes retries safe. |
| The same schema everywhere | Templates: SQL, a migration list, or a copy of an existing project’s migrations / schema, plus seed data, applied before the project is reported ready. |
| Projects that clean themselves up | ttl_seconds / expires_at: deleted automatically, with a project.expired event. |
| Your own ids on our projects | Up to 20 labels per project; filter lists with ?label=customer_id:cus_123; paginate with ?limit + X-Next-Cursor. |
| Per-customer limits | Caps below your plan on database size, file storage, requests per second, connections, realtime, end users, Edge Functions. Enforced by the platform, not by your code. |
| Metering to bill your customers | Daily usage per project: requests, egress, database and file size, end users, monthly active users, function invocations; organization CSV export. |
| Knowing what happened | Webhooks: project lifecycle, usage thresholds, limits reached, backups, deploys, members; HMAC-signed with retries. |
| Operating projects | Pause, restore, delete, rotate API keys (with a grace period), change Auth settings (site URL, redirect URLs, providers, SMTP) through the API. |
| Agents operating projects | MCP tools including create_project, get_usage, set_project_limits, pause_project and rotate_api_keys, with organization tokens. |
| Handing a project to a customer | Claim links: the customer takes the project into their own StitchDB organization (their plan and billing), you keep a role if you want. |
| A machine-readable API | OpenAPI 3.1 document for code generation. |
| Larger volumes and invoice billing | Enterprise plans: custom limits and project counts, invoice billing with a credit limit (no card), dedicated boxes. Contact us. |
#Isolation between your customers
Every project is its own Postgres database with its own roles, password, JWT secret and API keys; one customer's keys never reach another customer's data. Per-project limits (requests per second, connections, size) keep one busy customer from slowing the others down. See Security.
#White label
Your customers' end users only see what you configure: set each project's site URL, redirect URLs, SMTP server (your own sender domain) and e-mail templates through the Auth settings API, so sign-up, magic-link and recovery e-mails come from your brand and point to your app. API URLs are https://<ref>.p.stitchdb.com; custom domains per project are on the roadmap.
#Not yet available
- Custom domains per project (your own API host name).
- Copying data between projects (templates copy schema and seed data, not rows).
- Realtime peak connections in the usage export (requests, egress, sizes, users and invocations are metered).