Sponsored by Upstash. The implementation and opinions in this article are my own.
A rate limiter is supposed to stop requests when someone goes over the limit. So the 200 OK response recorded in an earlier local test without Redis credentials caught my attention.
The notes from that earlier test also recorded x-ratelimit-limit: 0 . In that run, the endpoint was accepting requests without an effective limit. That was an exploratory observation, not the result from the final implementation.
I used Upstash Redis with its rate-limiting SDK for this Next.js example. That sent me back to the SDK's timeout behavior. Here's the small Next.js setup, what the documentation says, and the failure case I'd check before using it on a paid API.
Set Up Rate Limiting in Next.js with Upstash Redis
The live-tested demo used Next.js 16.4.6, @upstash/ratelimit 2.2.3, and @upstash/redis 1.41.1.…