Protect your application from abuse with intelligent rate limiting
Low latency, high throughput rate limiter optimised for simplicity and performance.
a
b
c
Token Bucket Rate Limiter
import { RateLimiter } from "limit-api";const limiter = new RateLimiter({apiKey: "your-api-key",}, {type: "token-bucket",maxTokens: 3,refillRate: {tokens: 1,seconds: 3,},});// ...const {rateLimited,remainingRequests,} = await limiter.limit(apiKey);
Max tokens can be anywhere between 1 and 20
Refill amount can be anywhere between 1 and 10
Refill seconds can be anywhere between 1 and 10
Accepted Request
Rejected Request
Max Tokens: 3 | Refill Rate: 1 / 3s
Tokens Remaining: 3
Sliding Window Rate Limiter
import { RateLimiter } from "limit-api";const limiter = new RateLimiter({apiKey: "your-api-key",}, {type: "sliding-window",maxRequests: 3,windowSeconds: 6,});// ...const {rateLimited,remainingRequests,} = await limiter.limit(apiKey);
Window can be anywhere between 1 second and 200 days
Max requests can be anywhere between 1 and 1 trillion
Window Size: 6s | Max Requests: 3 | Requests Remaining: 3
Accepted Request
Rejected Request
Fixed Window Rate Limiter
import { RateLimiter } from "limit-api";const limiter = new RateLimiter({apiKey: "your-api-key",}, {type: "fixed-window",maxRequests: 3,window: {seconds: 6,},});// ...const {rateLimited,remainingRequests,} = await limiter.limit(apiKey);
Window can be anywhere between 1 second and 200 days
Max requests can be anywhere between 1 and 1 trillion
Window Size: 6s | Max Requests: 3 | Requests Remaining: 3
Accepted Request
Rejected Request
Pricing that scales with your business
$5.00
/ month
Rate limit API Calls | |
---|---|
First 500K | Included |
Over 500K | $1.00 / 100K |
Over 10M | $0.50 / 100K |