Implement rate limiting for APIs with various algorithms
Implement rate limiting for my API: API Type: [REST/GraphQL] Framework: [Express/FastAPI/Django/Go/etc.] Scale: [REQUESTS PER SECOND EXPECTED] Deployment: [SINGLE SERVER/DISTRIBUTED] Rate Limit Requirements: - Limit type: [PER USER/PER IP/PER API KEY] - Limits: [e.g., 100 requests/minute, 1000 requests/hour] - Burst allowance: [YES/NO] - Different tiers: [FREE/PRO/ENTERPRISE limits] Please provide: 1. Algorithm recommendation (token bucket/sliding window/etc.) 2. Complete implementation code 3. Storage backend setup (Redis/in-memory) 4. Response headers (X-RateLimit-*) 5. Graceful degradation strategies 6. Distributed rate limiting considerations
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[REQUESTS PER SECOND EXPECTED]