Skip to content
Back to skills

Rate Limiting Design

ASecurity

Design and implement rate limiting strategies to protect APIs and services from abuse while maintaining quality of service.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 6, 2026
ai-agentspythongoapisecurityperformance

Works with

  • cursor
  • cli
  • api

Security analysis

A100/100

Scanned September 6, 2026

npx -y skills add AtulPurohit/Antigravity-Awesome-Skills --skill rate-limiting-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rate Limiting Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rate Limiting Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/atulpurohit-rate-limiting-design/badge)](https://www.skillsdirectory.com/skills/atulpurohit-rate-limiting-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rate-limiting-design
description: "Design and implement rate limiting strategies to protect APIs and services from abuse while maintaining quality of service."
category: architecture
tags: [rate-limiting, throttle, api, security, performance]
complexity: advanced
risk: low
compatibility: [claude-code, antigravity, gemini-cli, cursor, copilot, codex-cli, autohand, kiro]
source: antigravity-official
version: "1.0.0"
date_added: "2026-07-10"
last_updated: "2026-07-10"
---

# Rate Limiting Designer

## Purpose
Protect APIs and services from abuse, ensure fair usage, and maintain system stability under high load.

## Rate Limiting Algorithms

### Fixed Window
```
Simplest: Count requests per time window
Problem: Allows 2x burst at window boundary

Window: 10 requests per minute
Key: user:123:2026-07-10-10:30
```

### Sliding Window (Recommended)
```python
def check_rate_limit(user_id: str, limit: int, window: int) -> bool:
    now = time.time()
    window_start = now - window
    key = f"ratelimit:{user_id}"
    
    # Remove expired entries
    redis.zremrangebyscore(key, '-inf', window_start)
    
    # Count in current window
    count = redis.zcard(key)
    if count >= limit:
        return False
    
    # Add current request
    redis.zadd(key, {str(now): now})
    redis.expire(key, window)
    return True
```

### Token Bucket
```
Best for: Allowing bursts up to bucket capacity
Bucket: 100 tokens, refill 10/second
Each request: costs 1 token
Burst allowed: up to 100 requests instantly
```

## Response Headers
```
X-RateLimit-Limit: 100        # Limit per window
X-RateLimit-Remaining: 45     # Requests remaining
X-RateLimit-Reset: 1625000000 # Unix timestamp of window reset
Retry-After: 60               # Seconds until retry allowed (429 only)
```

## Tiered Rate Limits
```
Anonymous: 20 requests/minute
Free tier: 100 requests/minute
Pro tier: 1000 requests/minute
Enterprise: Custom
```

## Outputs
1. Rate limiting middleware implementation
2. Per-endpoint limit configuration
3. Response header standards
4. Bypass allowlist for internal services
5. Monitoring and alerting for rate limit events

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.