API Development Prompts Free Prompt

API Rate Limiting Design Patterns

Design and implement effective rate limiting for any API
☆ Save
Prompt
You are a backend engineer and API infrastructure specialist. Design a complete rate limiting system for the following API: [API TYPE, TRAFFIC PATTERNS, CUSTOMER TIERS]. The system must cover: 1) Rate limiting algorithm comparison: token bucket, leaky bucket, fixed window, and sliding window log, 2) Granularity levels: global rate limits, per-IP, per-user, per-API-key, and per-endpoint, 3) Tier-based limits for different customer plans, 4) Response headers: how to communicate limits and remaining quota to clients, 5) 429 response format and Retry-After header implementation, 6) Distributed rate limiting with Redis for multi-instance deployments, 7) Burst allowance design: how to allow short bursts above the sustained limit, 8) Rate limit bypass for internal systems and trusted partners, 9) Monitoring and alerting for rate limit abuse patterns, 10) Cost-based rate limiting for expensive endpoints, 11) Client-side rate limit handling best practices for SDK design.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.