rate-limiting

Enforce per-user and per-tier API quotas with a sliding window algorithm.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/jrmatherly/metorial-workspace --skill rate-limiting-jrmatherly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rate-limiting
Source: https://github.com/jrmatherly/metorial-workspace/tree/main/.github/skills/rate-limiting
Command: npx skills add https://github.com/jrmatherly/metorial-workspace --skill rate-limiting-jrmatherly

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps API developers enforce per-user and per-subscription tier rate limits to protect resources and ensure fair usage across tenants.

Core Features & Use Cases

  • Sliding window rate limiting that adapts to tiered limits.
  • Tier-based configuration (free, pro, enterprise) with per-minute quotas and burst allowances.
  • Middleware-ready integration for Express.js, FastAPI, or any HTTP server; headers expose rate limit status.
  • Use Case: A SaaS API serving thousands of customers uses this to prevent abuse while honoring tiered plans.

Quick Start

Install a Redis client, initialize a RateLimiter with a Redis connection, and mount the provided middleware in your API.

Frequently Asked Questions about rate-limiting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement tiered API rate limiting for a SaaS application?

Tiered API rate limiting is implemented by enforcing per-user and per-subscription quotas using a sliding window algorithm. This approach allows you to define distinct limits for free, pro, and enterprise tiers to ensure fair usage across tenants.

What is a sliding window rate limit algorithm and when should I use it?

A sliding window rate limit algorithm tracks requests continuously over a rolling time period rather than resetting at fixed intervals. Use it for SaaS APIs to provide smoother traffic distribution and prevent burst abuse at window boundaries.

Can I use Redis for rate limiting middleware in FastAPI or Express?

Yes, you can use Redis for rate limiting middleware in FastAPI or Express. You initialize a RateLimiter with a Redis connection and mount the provided middleware directly into your HTTP service to enforce quotas.

How do I return rate limit headers like remaining and retry information in my API?

To return rate limit headers like remaining and retry information, you mount the rate limiting middleware in your HTTP service. It automatically exposes headers containing remaining, reset, and retry details for the client.

Does this sliding window rate limiter support burst allowances for different subscription levels?

Yes, the sliding window rate limiter supports burst allowances for different subscription levels. It features tier-based configuration for free, pro, and enterprise plans with specific per-minute quotas and burst limits.