For serverless or edge code, Upstash Ratelimit is a library built for that job. If you want limits in front of every API, an open source gateway such as Kong, Tyk or Apache APISIX does it. If you already sit behind Cloudflare or AWS, their edge and WAF products block traffic before it reaches your servers.
Quick note on sources: the table and entries come from each vendor's homepage, features page or pricing page as I read them in December 2026, and from nothing else. A few guessed features URLs returned errors, so I used the pages that loaded. I didn't load-test any of these limiters myself.
Ten rate limiters at a glance
Three kinds of tool sit in this table: libraries you call from your own code, gateways and proxies that sit in front of your services, and network or firewall products run by a large provider.
| Tool | Type of tool | Where the limit is applied | Free route the page states |
|---|---|---|---|
| Upstash Ratelimit | HTTP-based rate limiting library | Serverless functions and edge runtimes | 500K commands a month on the free tier |
| Kong | Open source and Enterprise API gateway | Plugin tiers applied to consumer groups | 30-day free trial, no credit card |
| Cloudflare Rate Limiting | Product on Cloudflare's network | At the edge, before your origin server | Free plan listed; rate limit allowance per plan not stated |
| Unkey | Developer platform with gateway and keys | Global gateways at the edge | Free to start, usage-based plans |
| Zuplo | API gateway with AI and MCP gateways | 300+ edge locations | Free tier paused; free trial on request |
| Tyk | Open source API gateway, MPL 2.0 | Self-managed gateway or Tyk Cloud | Open source gateway; 48-hour Cloud trial |
| Envoy | Open source edge and service proxy | Proxy; token-aware limits in its AI Gateway on Kubernetes | Open source download |
| Arcjet | Security SDK with rate limiting as one building block | In your code through JavaScript, Python and Go SDKs | 15-day trial |
| AWS WAF | Web application firewall with rate-based rules | Web ACLs on CloudFront, load balancers or API Gateway | AWS Free Tier linked; no WAF allowance stated |
| Apache APISIX | Open source API and AI gateway, Apache 2.0 | Gateway plugins; token limits per consumer | Open source |
4 of the 10 are open source projects or offer an open source edition you can self-host for free. 1 of the 10, AWS WAF, does not publish a free allowance figure for its rate rules on its product page.
Each tool in a few lines
Upstash Ratelimit
Upstash Ratelimit is an HTTP-based library built for serverless functions and edge runtimes such as Cloudflare Workers and Vercel Edge, with multi-region and multiple-limit options. Skip it if your services aren't written in TypeScript or Python, the two SDKs its docs cover.
Kong
Kong's features page lists advanced rate limiting with sliding window controls, plus consumer groups for applying limits to subsets of users, across open source, Enterprise and Konnect editions. Skip it if you want one flat monthly fee; pricing runs on usage and control planes.
Cloudflare Rate Limiting
Cloudflare applies rate limits at its edge, across 335+ cities, before traffic reaches your origin, and rules can key on headers, query parameters or a WAF check result rather than IP alone. Skip it if your traffic doesn't run through Cloudflare's network.
Unkey
Unkey pairs API keys and instant revoke controls with edge rate limits on global gateways, and offers startups credits every month for twelve months. Skip it if you want a drop-in limiter alone; the pricing page sells compute plans for hosting your whole API.
Zuplo
Zuplo's features page describes dynamic rate limiting and hard token budgets for AI spend, on a gateway with 300+ edge locations. Its pricing page says the free tier is paused and pay-as-you-go is coming soon. Skip it if you need self-serve signup today.
Tyk
Tyk's open source gateway, under MPL 2.0, covers auth, rate limits and quotas for REST and GraphQL, and Tyk Cloud has a 48-hour trial. Skip it if you want listed prices before a sales call; its Core, Professional and Enterprise plans show Get pricing.
Envoy
Envoy is an open source edge and service proxy and a graduated Cloud Native Computing Foundation project, supporting HTTP/3 and gRPC. Token-aware rate limiting comes with its AI Gateway on Kubernetes. Skip it if you want AI token limits without running Kubernetes.
Arcjet
Arcjet treats rate limiting as one building block beside bot protection and a Shield WAF, using a token bucket keyed on characteristics you choose, with JavaScript, Python and Go SDKs. Skip it if you need more than an hour of logs on its entry plan.
AWS WAF
AWS WAF uses rate-based rules inside web ACLs, which you attach to CloudFront distributions, Application Load Balancers or API Gateway APIs. Its page frames those rules around blocking DDoS traffic. Skip it if your application runs outside AWS.
Apache APISIX
Apache APISIX is a top-level Apache Software Foundation project, Apache 2.0 licensed, with 100+ open-source plugins and token-based rate limits per consumer in its AI Gateway. Skip it if you want a hosted service with a price list rather than downloads and docs.
Library, gateway or network: where the limit should live
Do you make a rate limiting tool or API gateway? Tool makers can ask to be considered for a featured place on this list.
The same rule, say 100 requests a minute per customer, behaves differently depending on where you enforce it. Picking the layer first narrows this list to two or three tools.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
In your code, with a library or SDK. The limit knows everything your application knows: who the user is, which plan they're on, how expensive this particular call is. That makes it the best place for business rules such as free and paid tiers or cost-weighted AI calls. The downside is that the request has already reached your servers, so a flood still costs you compute. 2 of the 10 tools here work this way.
In a gateway or proxy in front of your services. One configuration covers every API behind it, and the limit applies before your application code runs. This suits teams with several services or several languages, because you don't reimplement limits in each one. The trade-off is another component to run, upgrade and monitor, unless you pay for a hosted edition. 6 of the 10 tools here are gateways, proxies or gateway platforms, and 4 of those offer open source editions.
At the network edge or in a firewall. Traffic is counted and blocked before it ever reaches your infrastructure. This is the layer for brute-force login attempts, scrapers and volumetric abuse. It knows less about your users than your own code does, so pair it with an inner limit for plan-based rules. 2 of the 10 tools here are provider network or firewall products, and each one assumes your traffic already runs through that provider.
Many teams end up with two layers: a coarse edge or gateway limit to absorb abuse, and a fine application limit for fair use between customers. If you're comparing gateways for the middle layer, my notes on open source API gateways worth self-hosting go further into running one yourself.
Choosing an algorithm and a key
Every limiter needs two decisions: how to count and what to count against.
Fixed windows are the simplest: reset the counter every minute. They allow a burst at the edge of each window, since a client can send a full allowance at 59 seconds and another at 61. Sliding windows smooth that out by looking back over a rolling period. Token buckets refill at a steady rate and let a client spend saved-up tokens in a short burst, which matches how real users behave. Token buckets also let you charge different amounts per request, which is how cost-weighted AI limits work: a long prompt spends more tokens than a short one.
The key is what you count against. IP address is easy but unfair behind offices and mobile networks, where many people share one address. API key or user ID is fairer for authenticated traffic. Organisation ID stops one customer's many users from crowding out everyone else. For login pages, count failed attempts per account as well as per IP, so a slow attack spread over many addresses still trips the limit.
Signs your limits need another look
- Support tickets about 429 errors from paying customers. Your limits are tuned for abuse, not for real usage. Look at the busiest legitimate client and set the limit above it.
- No Retry-After header. Clients that don't know when to retry will hammer you again at once. Send the header and document it.
- Limits that reset on deploy. If counters live in process memory, every restart wipes them. Use a shared store or a gateway that holds state.
- One global limit for every endpoint. A search endpoint and a login endpoint need different numbers. Split them.
- No logging of blocked requests. If you can't see what you block, you can't tell an attack from a customer's broken script.
Rolling out limits without locking customers out
Start in log-only mode where the tool allows it, record what would have been blocked for a week, and compare that against your real customer list. Then switch on enforcement with limits set comfortably above the busiest legitimate client, publish the limits in your API docs, and tighten them gradually as you learn. Tell customers before you lower a limit, and give your largest accounts a way to ask for more. A limit that surprises a paying customer costs more than the abuse it stops.
Want your tool on this list? Featured spots and reviews here are paid partnerships. Here's how to partner with me.
Frequently asked questions
What is the best algorithm for API rate limiting?
A token bucket fits a wide range of APIs, because it allows short bursts while holding a steady average and can charge different costs per request. Sliding windows are a good second choice when you want strict per-period counts without the burst at window edges.
Should rate limiting happen at the gateway or in application code?
Both, if you can. A gateway or edge limit stops floods before they reach your servers, and an application limit applies plan-based rules that need to know who the user is and what they pay for.
Is there a free rate limiting tool?
Yes. 4 of the 10 tools here are open source projects or have an open source edition you can run yourself at no licence cost, and several hosted options list a free tier or a trial on their pricing pages.
How do I rate limit AI or LLM API usage?
Count tokens, not requests. Several tools here describe token-based or token-aware limits for AI traffic, so a long prompt uses more of the allowance than a short one.


