sickn33/agentic-awesome-skills/api-rate-limit-handler
Claude Code and agent skill by sickn33/agentic-awesome-skills
- community
Checking that the SKILL.md file is still in the repository.
Implement bounded, idempotency-aware API throttling, backoff, and retry handling for 429 and transient 5xx responses.
Install
npx vskill@latest install sickn33/agentic-awesome-skills/api-rate-limit-handlerSKILL.md
API Rate Limit Handler
Overview
A skill for implementing production-grade rate limiting, exponential backoff, and retry strategies when integrating with external APIs. Prevents cascading failures, respects upstream quotas, and keeps your application resilient under load.
When to Use This Skill
- Use when calling external APIs that enforce rate limits (OpenAI, Stripe, GitHub, etc.)
- Use when you receive 429 Too Many Requests or 5xx errors and need graceful recovery
- Use when building a client that must respect
Retry-Afterheaders - Use when designing a system that fans out to multiple API providers
- Use when the user says "handle rate limits", "add retry logic", "backoff strategy", or "don't get throttled"
How It Works
Step 1: Classify the response
Determine whether a failed request is retryable or terminal.
| Status | Classification | Action | |
|---|---|---|---|
| 200-299 | Success | Return response | |
| 400, 401, 403, 404 | Terminal client error | Do not retry — fix the request | |
| 408, 429 | Retryable (rate limit / timeout) | Retry with backoff | |
| 500, 502, 503, 504 | Retryable (server error) | Retry with backoff |
Step 2: Parse rate limit headers
Always check upstream hints before computing your own delay.
Upstream hints are minimum waits; never truncate them to retry early. If a hint exceeds the remaining operation budget, stop without scheduling another request. The cap applies only to fallback backoff.
Provider-specific reset headers do not share one unit or format. For example, some APIs return durations while GitHub returns epoch seconds. Parse an additional header only after checking that provider's current documentation.
Step 3: Implement the retry loop
Step 4: Add a client-side rate limiter (proactive)
Prevent hitting upstream limits in the first place with a token bucket or sliding window.
Examples
Example 1: Idempotent API read with retry
For a POST or another operation with side effects, leave retryNonIdempotent false unless the provider documents an idempotency mechanism and the same stable idempotency key is reused for every attempt.
Example 2: Python implementation
Best Practices
- ✅ Always respect
Retry-Afterheaders — they come from the provider who knows their limits - ✅ Add jitter to backoff to prevent thundering herd when multiple clients retry simultaneously
- ✅ Log every retry with status code, delay, and attempt number for debugging
- ✅ Set a maximum total timeout to avoid hanging indefinitely
- ✅ Use a client-side rate limiter proactively rather than only reacting to 429s
- ✅ Retry state-changing requests only with a provider-documented idempotency mechanism and a stable key
- ❌ Don't retry 4xx client errors (except 408 and 429) — fix the request instead
- ❌ Don't use fixed delays — exponential backoff distributes load more evenly
- ❌ Don't retry without a cap — unbounded retries can amplify outages
- ❌ Don't ignore per-endpoint limits — some APIs have different quotas per route
Limitations
- This skill does not replace environment-specific validation, testing, or expert review.
- Token bucket is approximate for distributed systems — use Redis-backed rate limiting for multi-instance deployments (for example the
upstash-ratelimitskill, or any shared-store limiter). - Some APIs use non-standard rate limit headers; check provider documentation.
- The elapsed-time cap shown here bounds retry waits, not a single hung network call; combine it with an
AbortSignalor client timeout.
Common Pitfalls
- Problem: Retrying too aggressively during an outage amplifies the problem.
Solution: Use exponential backoff with jitter and a circuit breaker for sustained failures.
- Problem: Multiple instances of your app all retry at the same time (thundering herd).
Solution: Add randomized jitter (Math.random() * 0.3 * delay) to decorrelate retries.
- Problem: Retry-After header contains an HTTP-date instead of seconds.
Solution: Parse both formats — check if the value is numeric first, then try Date parsing.
- Problem: Client-side limiter doesn't account for concurrent requests already in-flight.
Solution: Serialize acquisition within one process, decrement before send, and use a shared distributed limiter across instances.
Related Skills
@poka-yoke- Mistake-proofing APIs so invalid requests never reach the retry path@circuit-breaker- When to stop retrying entirely and fail fast
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/api-rate-limit-handler/SKILL.md
Popularity
- Repository stars
- 47,056
- Repository forks
- 6,853
- 7-day trend score
- 54
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sickn33/agentic-awesome-skills/api-rate-limit-handler)