Skip to main content
Brew rate-limits every authenticated public v1 endpoint to keep the platform fast and fair. Limits are per API key, per route, per rolling 60-second window, surfaced on rate-limited responses, and recoverable via standard Retry-After semantics. The no-auth GET /v1/health and GET /v1/help discovery surfaces explicitly have no rate limit.

Headers

Every rate-limited response carries the rate-limit headers, and a 429 RATE_LIMITED or retryable 503 response also carries Retry-After. See Response headers for the complete header catalog and wire-level examples. This page owns the policies and recovery behavior.

Per-Route Policies

Each route declares a named policy in lib/api/rate_limit/policy.ts. The policy name appears in observability dashboards. HTTP rate-limit failures use the stable RATE_LIMITED error code, with the policy context available in the message or logs.

Session Traffic: 300/min Ceiling

UI-backed session traffic (dashboard, Brew chat orchestrator) gets a flat 300/min ceiling across every policy above so a busy operator never blocks themselves while editing. API-key traffic uses the strict per-route limits in the table.

Generosity & Burst Behavior

  • The window is a rolling 60 seconds, not a fixed wall-clock minute. A spike at the top of a minute does NOT get a free second budget.
  • The store uses Redis sorted-sets (when available); when Redis is unavailable, every rate-limited endpoint fails open with X-RateLimit-Remaining: <limit> and X-RateLimit-Reset: now+60. You will not see spurious 429s during a Redis blip.
  • Test mode bypass: BREW_DISABLE_API_RATE_LIMIT=1 on the dev server skips the gate entirely (test-only env var; never set in production).

429 Recovery Cookbook

The canonical retry loop:
Key invariants:
  • Always honor Retry-After. Take the max of Retry-After and your own back-off so you don’t out-aggressive yourself.
  • Reuse the same Idempotency-Key on every retry. See Idempotency for replay semantics.
  • Preemptively pause when X-RateLimit-Remaining hits 0. The header ships on rate-limited responses, so a well-behaved client can throttle itself before a 429 ever fires.
The standard 429 RATE_LIMITED and retryable 503 envelopes, including error.retryAfter, are documented in Errors. The header and body carry the same wait duration.

Server-Side Observability

Every rate-limited response logs a structured warning with the policy name, the API key id, and the remaining count. If you see persistent 429s in production that don’t match your expected QPS, contact support with the x-request-id from any 429 response. We can look up the per-key window state and diagnose.

See Also

  • Idempotency: pair with Idempotency-Key so retries are safe.
  • Errors: full error envelope + every error.code.
  • Response headers: every header Brew sets.
  • Async jobs & polling: for POST /v1/sends and POST /v1/automations/triggers/{triggerEventId}/fire, you don’t need to call the API again to wait for delivery. Poll the run.

Need Help?

Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:

Search Documentation

Type in the “Ask any question” search bar at the top left to instantly find relevant documentation pages.

ChatGPT/Claude Integration

Click “Open in ChatGPT” at the top right of any page to explore it further with ChatGPT or Claude.