Skip to main content
Limitguard enforces rate limits to ensure fair access and API stability. They are abuse limits, not a quota you buy: every call is paid for, either per call with x402 or from an API key’s prepaid balance. A key’s tier (bought as a prepaid top-up) only selects its burst limits and its monthly cap.

Rate Limits by Tier

The per-minute and daily windows are rolling: the per-minute limit over the last 60 seconds, the daily limit over the last 24 hours. Only the monthly cap resets on a calendar boundary (see below). Entity checks also have a per-entity limit per caller, against enumeration.

Monthly Cap per Key

Every API key also has a calendar-month cap. It equals the tier’s number in the table above. Like the other limits it is an abuse cap, not prepaid balance.
  • What counts: each authenticated call made with the key, over REST or MCP. A call that you also pay for with x402 counts but is never refused by the cap. A call the cap refuses is not counted.
  • Reset: at 00:00 UTC on the 1st of each month.
  • When it is reached: the next call gets a 429 with Retry-After set to the seconds left until the reset. The body is a problem details object. Its detail shows usage against the cap, and for a priced endpoint it quotes the price and offers to pay keyless with x402 instead. It does not carry the X-RateLimit-* headers.

Middleware Execution Order

Sandbox detection runs first, then rate limiting, then x402 payment verification. Rate limiting runs before x402 so that an anonymous caller cannot make the API spend upstream calls on fake payment proofs:
A sandbox request that exceeds 10 req/min is rejected by the Sandbox step itself, which answers its own 429 before the Rate Limit step 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

The sandbox 429 carries only Retry-After, not the X-RateLimit-* headers.

Example: Free Tier Daily Limit Reached

Always read the Retry-After header rather than hard-coding a wait time: it is 60 seconds for a per-minute limit, 3600 seconds for the rolling 24-hour limit, and the seconds until the 1st of the next month (00:00 UTC) for the monthly cap.

x402 Payers Have No Daily Cap

Callers paying per call with x402 have no daily request cap: each successful payment authorizes exactly one API call, so cost is the throttle. A verified payer is still limited to 60 requests per minute, and entity checks keep their per-entity limit.
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 have no daily cap. 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 counts against the same window 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 a sandbox key (lg_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 an API key, you have two options:

Top up to a higher tier

Top up to Indie, Starter, Growth, or Pro for higher per-minute and daily limits.

Switch to x402

Pay per call with USDC. No daily cap; 60 requests per minute per payer.
To create a key, then upgrade it:
Available tiers: free, sandbox, indie, starter, growth, pro. See Authentication for top-up prices and limits.