Hello NestJS enthusiasts! Great news for those of you running multi-tenant APIs and struggling with usage tracking. It's time to get acquainted with `nestjs-quota`, an open-source package that aims to simplify and improve how you manage your API quotas.

We all know that a simple rate limiter isn't enough for today's complex applications. You need to answer "may this request proceed?" against several limits simultaneously, such as requests per user per minute, or per tenant per day, or even per month. Furthermore, accurately tracking actual usage for each tenant is crucial for billing and dashboards.

This is precisely what `nestjs-quota` solves. Instead of dealing with each limit individually, which can lead to problems like race conditions where quotas might be exceeded, or partial charges where a request is debited but then rejected due to another limit, `nestjs-quota` avoids all that. This innovative solution checks and consumes all relevant quotas in one atomic operation. This means you'll never end up with a request that's been partially charged only to be rejected later.

What truly sets `nestjs-quota` apart is its ability to work across multiple servers using a single Redis Lua script for each decision, ensuring consistency. It also supports idempotent retries and offers reserve/commit/release options for operations where the cost isn't known upfront. You can even set plan-based dynamic limits (like free vs. pro tiers) and configure fail-open or fail-closed behavior. The solution ships with NestJS decorators, a guard, and an interceptor, and its core has zero runtime dependencies, making Redis and NestJS optional layers. It's a truly flexible and powerful solution that makes API quota management simple and secure.