Agent skill · Backend & API

api-rate-limiting

Implement API rate limiting strategies using token bucket, sliding window, and fixed window algorithms. Use when protecting APIs from abuse, managing traffic, or implementing tiered rate limits.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill api-rate-limiting-aj-geddes-useful-ai-prompts-2 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 9 KB
Bundled scripts: none
Path: skills/api/api-rate-limiting-aj-geddes-useful-ai-prompts-2/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# API Rate Limiting ## Overview Protect APIs from abuse and manage traffic using various rate limiting algorithms with per-user, per-IP, and per-endpoint strategies. ## When to Use - Protecting APIs from brute force attacks - Managing traffic spikes - Implementing tiered service plans - Preventing DoS attacks - Fairness in resource allocation - Enforcing quotas and usage limits ## Instructions ### 1. **Token Bucket Algorithm** ```javascript // Token Bucket Rate Limiter class TokenBucket { constructor(capacity, refillRate) { this.capacity = capacity; this.tokens = capacity; this.refillRate = refillRate; // tokens per second this.lastRefillTime = Date.now(); } refill() { const now = Date.now(); const timePassed = (now - this.lastRefillTime) / 1000; const tokensToAdd = timePassed * this.refillRate; this.tokens = Math.min(this.capacity, this.tokens + tokensToAdd); this.lastRefillTime = now; } consume(tokens = 1) { this.refill(); if (this.tokens >= tokens) { this.tokens -= tokens; return true; } return false; } available() { this.refill(); return Math.floor(this.tokens); } } // Express middleware const express = require('express'); const app = express(); const rateLimiters = new Map();

What's inside
Steps it walks through
  1. Overview
  2. When to Use
  3. Instructions
  4. 1. Token Bucket Algorithm
  5. 2. Sliding Window Algorithm
  6. 3. Redis-Based Rate Limiting
  7. 4. Tiered Rate Limiting
  8. 5. Python Rate Limiting (Flask)
  9. 6. Response Headers
  10. Best Practices
  11. ✅ DO
  12. ❌ DON'T
  13. Monitoring
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the api-rate-limiting skill do?

Implement API rate limiting strategies using token bucket, sliding window, and fixed window algorithms. Use when protecting APIs from abuse, managing traffic, or implementing tiered rate limits.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill api-rate-limiting-aj-geddes-useful-ai-prompts-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going