/api-rate-limiting
Implements API rate limiting using token bucket, sliding window, and Redis-based algorithms to protect against abuse. Use when securing public APIs, implementing tiered access, or preventing denial-of-service attacks.
One skill from claude-skills.
shell
$ npx -y skills add secondsky/claude-skills --skill api-rate-limiting --agent claude-codeInstalls just this skill. Get the whole plugin for auto-invocation.
How it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/api-rate-limiting
Context preview
The summary Claude sees to decide when to auto-load this skill.
Implements API rate limiting using token bucket, sliding window, and Redis-based algorithms to protect against abuse. Use when securing public APIs, implementing tiered access, or preventing denial-of-service attacks.
Stats
Stars194
Forks29
LanguageTypeScript
LicenseMIT
Ships with claude-skills
SKILL.md
api-rate-limiting.SKILL.md
--- name: api-rate-limiting description: Implements API rate limiting using token bucket, sliding window, and Redis-based algorithms to protect against abuse. Use when securing public APIs, implementing tiered access, or preventing denial-of-service attacks. license: MIT --- # API Rate Limiting Protect APIs from abuse using rate limiting algorithms with per-user and per-endpoint strategies. ## Algorithms | Algorithm | Pros | Cons | |-----------|------|------| | Token Bucket | Handles bursts, smooth | Memory per user | | Sliding Window | Accurate | Memory intensive | | Fixed Window | Simple | Boundary spikes | ## Token Bucket (Node.js) ```javascript class TokenBucket { constructor(capacity, refillRate) { this.capacity = capacity; this.tokens = capacity; this.refillRate = refillRate; // tokens per second this.lastRefill = Date.now(); } consume() { this.refill(); if (this.tokens >= 1) { this.tokens--; return true; } return false;
