Most rate limiters pick an arbitrary number — “100 requests per minute” — and apply it to every app equally. LintLiot does something different: it watches your app’s traffic for 7 days, builds a statistical baseline, and then sets limits relative to what’s actually normal for your specific app. An endpoint that legitimately handles 500 requests per minute won’t be throttled. An endpoint that normally gets 2 requests per minute will trigger an alert at 50.Documentation Index
Fetch the complete documentation index at: https://docs.lintliot.com/llms.txt
Use this file to discover all available pages before exploring further.
How baseline-relative limits work
After the 7-day learning phase completes, LintLiot calculates a per-IP threshold using this formula:3 × stddev factor corresponds to a 3-sigma rule: legitimate traffic that falls within 3 standard deviations of the mean has a 99.7% chance of being normal. Traffic beyond that threshold is almost certainly anomalous.
During learning mode, the SDK uses conservative static defaults. The moment you enable enforcement from the dashboard on Day 8, thresholds switch to your app’s learned baselines. Baselines continue to adapt over time using an exponential moving average (α = 0.1) so your limits drift upward naturally as your app grows.
Your app is protected by standard static rate limits during the 7-day learning phase. Learning mode only affects which thresholds are used — blocking is always on.
Rate limit algorithms
LintLiot supports four rate limiting strategies. The default issliding-window-counter, which gives the most accurate results with minimal memory overhead.
Sliding window counter (default)
Sliding window counter (default)
Blends the current and previous fixed windows proportionally to the current position in time. This eliminates the burst edge case of fixed-window counters where a client can send 2× the limit in a short burst at a window boundary.
Sliding window log
Sliding window log
Stores an exact timestamp for every request in the current window. Most accurate — a client can never exceed the limit by any amount — but uses more memory. Best for endpoints where precise enforcement matters more than efficiency.
Fixed window
Fixed window
Counts requests in a fixed time bucket. Simplest and cheapest, but allows brief bursts of up to 2× the limit at window boundaries. Suitable for high-throughput endpoints where approximate limiting is acceptable.
Token bucket
Token bucket
Clients accumulate tokens at a steady rate and consume one token per request. Naturally tolerates burst traffic up to the bucket size while enforcing an average rate over time. Good for APIs that should allow short bursts from legitimate users.
Configuring rate limits
Global rate limit via protect()
Pass rate limit options to lintliot.protect() to apply a limit globally across all routes:
Per-route rate limits
Apply different limits to specific routes by callinglintliot.rateLimit() directly as middleware:
All RateLimitOptions fields
DDoS spike detection
In addition to the window-based limiter, LintLiot tracks requests per second per IP in a 1-second window. If any IP exceeds theddosThreshold (default: 50 req/s), that IP is automatically blocked for 60 seconds and a critical event is logged.
This operates independently of the main rate limit window — it catches sudden bursts that a per-minute limit might not catch quickly enough.
Progressive penalties
Repeated violations result in escalating block durations:| Violation count | Block duration |
|---|---|
| 1st | 1× the rate limit window |
| 2nd | 2× the rate limit window |
| 3rd | 4× the rate limit window |
| 4th and beyond | 8× the rate limit window |
What happens when a rate limit is hit
When a request exceeds the rate limit, LintLiot returns a403 Forbidden response immediately — before your application code runs. The response includes:
retryAfter field is the number of seconds until the current window resets. The request is logged as a rate_limit event in your dashboard with the IP address, violation count, and window details.
