API Rate Limiter Design
Generates a complete rate limiting system design for your API, including strategy selection, implementation code, configuration, and monitoring setup.
When to use this prompt
You need to design or document a rate limiting system for an API or service with specific traffic patterns and user tiers. This template helps you evaluate different algorithms and produce implementation-ready specifications.
You are a backend engineer designing rate limiting systems. Design a rate limiting solution for [API/SERVICE]. Requirements: - Traffic: [REQUESTS/SECOND] - Endpoints: [ENDPOINT TYPES] - User tiers: [FREE/PAID/ENTERPRISE] - Infrastructure: [CLOUD/ON-PREM] Design: 1. Strategy selection - Fixed window vs sliding window - Token bucket vs leaky bucket - Trade-offs analysis 2. Limit configuration - Per-endpoint limits - Per-user tier limits - Global limits - Burst handling 3. Implementation - Storage (Redis/memory) - Key structure - Algorithm code 4. Response handling - Rate limit headers - Error response format - Retry-After header 5. Edge cases - Distributed systems - Clock skew - Failover behavior 6. Monitoring - Metrics to track - Alerting thresholds - Dashboard design Include code examples and configuration samples.
Free to use — the optimizer tailors this template to your exact task and target AI.
How to customize it
- [API/SERVICE] — Specify the API or service you're protecting (e.g., REST API, GraphQL endpoint, webhook service)
- [REQUESTS/SECOND] — Define expected traffic volume to inform algorithm selection and limit thresholds
- [ENDPOINT TYPES] — List the different endpoints that may need distinct rate limits (e.g., read vs. write operations, public vs. authenticated)
- [FREE/PAID/ENTERPRISE] — Describe your user tier structure to configure appropriate limits for each access level
What you'll get back
A structured rate limiting design document covering algorithm selection with trade-off analysis, specific limit configurations for each endpoint and user tier, implementation code with storage key structures, response handling specifications including headers, edge case handling for distributed systems, and monitoring setup with metrics and alerting thresholds. The output includes both code exampl
Related prompts
Unit Test Generator
Generates comprehensive unit tests for code in any language, covering happy paths, edge cases, errors, and integration points with clear structure.
Accessibility Audit Guide
Evaluates code or components against WCAG standards and disability-specific needs, returning categorized issues with severity ratings and code fixes.
API Endpoint Designer
Generates complete RESTful API endpoint specifications including HTTP methods, request/response formats, authentication, error codes, and OpenAPI snippets.
Architecture Decision Record
Generates a structured Architecture Decision Record (ADR) documenting technical choices, their context, consequences, and alternatives considered.
Bug Fix Assistant
Provides a structured format for submitting bug details to get root cause analysis, debugging steps, code fixes, and prevention strategies.
Build Your Complete CI/CD Pipeline with Quality Gates
Generates a complete CI/CD pipeline design with stages, quality gates, deployment strategy, and configuration files tailored to your tech stack and deployment target.
Make this prompt yours
PromptWizz rewrites this template around your specific task, audience, and target AI — and shows you why each change works.
Try the Optimizer Free