G
Platform

API Gateway

Per-project rate-limit policies with a live bucket inspector.

How it works

Every API key has a token bucket (refill rate + burst capacity). The bucket is held in ETS for O(1) atomic decrement and synced to Postgres every second. Policies define per-(project, key, route) limits. The dashboard shows the live state of every bucket — tokens remaining, refill rate — useful when debugging "why am I being rate-limited?".

What this lets you do

  • Protect upstream services from runaway clients
  • Per-project, per-key, per-route policies — granular control
  • Live bucket inspector — no guessing at rate-limit state
  • Returns standard `429` + `Retry-After` headers

Get it running

  1. 1 Default policies are sensible — no setup required
  2. 2 Override per-project in `API Gateway` → `Policies`
  3. 3 Inspect live buckets in the same page

Code examples

Open `API Gateway`. Each ingest pipeline (ingest, RUM,
workers, AI, api-read) has its own card showing the live
bucket fill bar and current capacity / refill rate.

Click `Edit` on the card you want to override, then set:

  Burst capacity        5000
  Sustained rate / sec  500

Save — the override persists in `gateway_policies` and the
live bucket is reset to full so the new limit takes effect
on the next request. Click `reset` later to revert to the
pipeline default.
Where to find it
/app/p/:org/:project/gateway
Open in app →