Skip to main content
LimitGuard enforces rate limits to ensure fair access and API stability. Limits differ by authentication mode and subscription tier. x402 callers are exempt from request-count limits — cost is the throttle.

Rate Limits by Tier

Monthly quotas reset on the first day of each calendar month (UTC). Minute-level limits use a rolling window, not a fixed clock boundary.

Middleware Execution Order

Rate limiting runs early in the stack — before sandbox bypass and x402 payment verification:
This means a sandbox request that exceeds 10 req/min is rejected at the Rate Limit step, before the sandbox middleware ever runs.

HTTP 429 — Rate Limit Exceeded

When a rate limit is hit, the API returns HTTP 429 Too Many Requests with a Retry-After header and a JSON error body.

Response Headers

Example: Sandbox Limit Exceeded

Example: Free Tier Monthly Quota Exhausted

Always read the Retry-After header rather than hard-coding a wait time. Monthly quota exhaustion returns a Retry-After value in days, not seconds.

x402 Has No Rate Limits

Callers using the x402 USDC micropayment protocol are not subject to request-count or per-minute rate limits. Each successful payment authorizes exactly one API call — the payment itself acts as the throttle.
If you are building an AI agent that may need to make bursts of requests, x402 is the right choice. You pay per call and are never blocked by quota exhaustion. See the x402 Protocol guide for implementation details.

Cost-Based Throttling vs. Count-Based Throttling

Best Practices

1. Always Respect Retry-After

Never retry before Retry-After seconds have elapsed. Retrying too early wastes your remaining quota and triggers the same 429 immediately.

2. Implement Exponential Backoff

For transient errors (5xx) use exponential backoff. For 429 specifically, always use the exact Retry-After value — do not apply additional multipliers on top of it.

3. Monitor X-RateLimit-Remaining

Poll X-RateLimit-Remaining on each response to detect approaching limits before they are hit. Shed load or switch to x402 before reaching zero.

4. Never Load Test Production

Use sandbox mode (X-LimitGuard-Mode: sandbox) for load testing. The 10 req/min sandbox limit exists to prevent accidental load on real data sources.

Code Examples: Handling 429 with Retry Logic

Upgrading Your Tier

If you are consistently hitting rate limits on a subscription key, you have two options:

Upgrade Your Plan

Move from Free to Starter, Pro, or Enterprise for higher per-minute and monthly limits.

Switch to x402

Pay per call with USDC. No quotas, no monthly limits — scales to any volume instantly.
To create or upgrade a key:
Available tiers: free, starter, pro, enterprise.