Skip to content

Limits

PerSQL is pay-as-you-go. There are no per-token throughput caps and no monthly request quotas — the prepaid balance is the spend control, and each database is its own Durable Object so tenants can’t crowd each other. The limits below are platform safety nets and protocol contracts.

LimitValue
batch statements per call100
Idempotency key length200 chars
Idempotency cache TTL24 hours
Public endpoint input body1 MB
ask endpoint result rowsaskConfig.maxRows, default 100
Question text length500 chars

A coarse per-IP flood control sits in front of /v1 and /api to short-circuit anonymous floods before they reach auth. A real customer never hits this; an attacker scripting from one host does. When it fires the response is 429 with a Retry-After header — the SDK throws a RateLimitError you can catch and retry.

Per-endpoint public endpoints (/p/:ns/:db/:slug) can also be configured with their own per-IP rate limits in the endpoint spec. See Endpoints overview.

CacheTTLInvalidation
Bearer token validation5minToken revoke
Endpoint resolution (/p/*)60sPublish / pause / delete
Custom hostname → (ns, db)60sRefresh / delete
Better Auth sessionper-requestSign-out
HeaderDirectionNotes
Authorization: Bearer …requestRequired on /v1/*, MCP, session-auth endpoints
Idempotency-KeyrequestOptional on /v1/query + /v1/batch, 24h replay
Idempotency-Replayed: trueresponseSet on cache hit
Retry-AfterresponseSeconds, set on 429
Cache-Control: public, max-age=30response.well-known/endpoints.json
Access-Control-Allow-OriginresponsePer-endpoint cors allow-list, or * on discovery
  • Per-row size cap. SQLite’s defaults apply (~1 GB / row). Don’t store blobs you wouldn’t put in a real Postgres column.
  • Long-running queries. Cloudflare Workers have a 30s CPU budget; queries that exceed it are killed. Use indexes.
  • Concurrent writers. Each database is single-threaded for writes. Heavy concurrent write workloads serialise — fine for typical SaaS, bad for high-throughput logging.