Rate Limits by Tier
| Tier | Requests / Minute | Requests / Month | Auth Method |
|---|---|---|---|
| Sandbox | 10 / min per IP | Unlimited | X-LimitGuard-Mode: sandbox or lg_test_ key |
| x402 (no key) | No limit | No limit | X-PAYMENT header (pay per call) |
| Free | 60 / min | 500 / mo | lg_live_ API key — free tier |
| Starter | 300 / min | TBD | lg_live_ API key — starter tier |
| Pro | 1,000 / min | TBD | lg_live_ API key — pro tier |
| Enterprise | Custom | Custom | lg_live_ API key — contact sales |
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:HTTP 429 — Rate Limit Exceeded
When a rate limit is hit, the API returns HTTP 429 Too Many Requests with aRetry-After header and a JSON error body.
Response Headers
| Header | Type | Description |
|---|---|---|
X-RateLimit-Limit | integer | Maximum requests allowed in the current window |
X-RateLimit-Remaining | integer | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp | When the current window resets (UTC epoch seconds) |
Retry-After | integer | Seconds to wait before retrying |
Example: Sandbox Limit Exceeded
Example: Free Tier Monthly Quota Exhausted
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.Cost-Based Throttling vs. Count-Based Throttling
| Mechanism | API Key Tiers | x402 |
|---|---|---|
| Per-minute limit | Yes | No |
| Monthly quota | Yes | No |
| Cost per call | No | Yes |
| Quota exhaustion risk | Yes | No |
| Suitable for AI agent bursts | No | Yes |
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 exactRetry-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.
free, starter, pro, enterprise.