rate-limiting

rate-limiting is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 142 tokens per session (2,593 once invoked), scanned A, original, MIT.

A guide to controlling how often clients can call a service or API. It covers design principles, system components, and a step-by-step architecture.

In plain words
What is it for?
Use it when designing request limits for clients, API gateways, microservices, and databases.
Why use it?
It helps prevent overloaded services, uneven traffic, and failures when demand increases. It also addresses reliability, scalability, security, and monitoring concerns.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Use it when designing request limits for clients, API gateways, microservices, and databases.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/rate-limiting
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j4flmao/agent-skills --skill rate-limiting
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rate-limiting

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/rate-limiting/github.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/rate-limiting)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/rate-limiting"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/rate-limiting/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rate-limiting

Your own site · 80×15
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/rate-limiting"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/rate-limiting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 142 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,593 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00142 $0.02593
Opus 5.5 $0.00057 $0.01037
Sonnet 5.5 $0.00028 $0.00519
Haiku 4.5 $0.00014 $0.00259

Measured yesterday against content hash b440bbe37167, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rate-limiting scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backend/universal/rate-limiting/SKILL.md · 198 lines

How it starts

The opening of the file, as written. The whole thing — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rate Limiting

Purpose

Protect services and enforce fair use by bounding how many requests (or how much cost) a client can consume per unit of time. Correct rate limiting needs the right algorithm, the right key (who is limited), the right enforcement point, and responses that let well-behaved clients back off.

Agent Protocol

Trigger

Exact user phrases: "rate limit", "rate limiting", "throttle requests", "token bucket", "leaky bucket", "sliding window", "429 too many requests", "API quota", "per-user limit", "distributed rate limiter", "Retry-After".

Input Context

  • What is being protected (whole API, expensive endpoint, login, outbound calls to a third party).
  • Identity available at enforcement time (API key, user ID, tenant, IP).
  • Number of instances and shared stores (Redis), gateway in front (Envoy, NGINX, Kong, cloud gateway).
  • Desired limits and burst tolerance.

Output Artifact

Limit policy table plus middleware/gateway code or config. No files unless requested.

Response Format

Scope: {endpoint/group}   Key: {api_key | user_id | tenant | ip}
Algorithm: {token bucket | sliding window counter | fixed window | GCRA}
Limit: {N} per {window}, burst {B}
Store: {in-memory | Redis (Lua, atomic) | gateway}
On limit: 429 + Retry-After {s} + RateLimit headers
Fail mode if store down: {open | closed}

Algorithms

Algorithm Behaviour Memory/key Bursts Notes
Fixed window counter INCR per window, reset at boundary 1 counter Up to 2x limit across a boundary Simplest; fine for coarse quotas (per day)
Sliding window log Store each request timestamp O(limit) Exact Precise but memory-heavy
Sliding window counter Weighted current + previous window counts 2 counters Approximate, smooth Good default for "N per minute" APIs
Token bucket Tokens refill at rate r up to capacity b; request spends tokens 2 values Allows bursts up to b Best when bursts are acceptable; supports variable cost
Leaky bucket (queue) Requests drain at fixed rate Queue Smooths output NGINX limit_req is leaky-bucket based
GCRA Token-bucket-equivalent using one timestamp (theoretical arrival time) 1 value Configurable Used by redis-cell and several gateways

Read the full file on GitHub · 198 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +75 lines · +121 tokens per session b440bbe37167
  2. 1mo ago First seen · 123 lines · 21 tokens per session scan A 563026c2c961

Subscribe to this mod's changes

rate-limiting is a skill published in the GitHub repository j4flmao/agent-skills (35 stars, last pushed yesterday), licensed MIT. It adds 142 tokens to every session and 2,593 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

implementing-api-rate-limiting-and-throttling

Implements API rate limiting and throttling controls using token bucket, sliding window, and fixed window algorithms to protect against brute force attacks, credential stuffing, resource exhaustion, and API abuse. The engineer configures per-user, per-IP, and per-endpoint rate limits using Redis-backed counters, API…

xalgorix/xalgorix · 114 tokens

api-rate-limiting-throttling-expert

Token bucket, sliding window, and Redis-based rate limiting for API protection. Activate on: rate limiting, throttling, token bucket, sliding window, API abuse, DDoS protection, quota management. NOT for: API gateway setup (use api-gateway-reverse-proxy-expert), caching (use cache-strategy-invalidation-expert).

curiositech/windags-skills · 81 tokens

implementing-api-rate-limiting-and-throttling

Implements API rate limiting and throttling controls using token bucket, sliding window, and fixed window algorithms to protect against brute force attacks, credential stuffing, resource exhaustion, and API abuse. The engineer configures per-user, per-IP, and per-endpoint rate limits using Redis-backed counters, API…

balsm-health/Balsm-AI · 114 tokens

implementing-api-rate-limiting-and-throttling

Implements API rate limiting and throttling controls using token bucket, sliding window, and fixed window algorithms to protect against brute force attacks, credential stuffing, resource exhaustion, and API abuse. The engineer configures per-user, per-IP, and per-endpoint rate limits using Redis-backed counters, API…

Njones17/AI-agent-master-cyber-skills-list · 114 tokens

API Rate Limiting Testing

Testing API rate limiting implementations including throttling behavior, burst handling, rate limit headers, and distributed rate limiting patterns.

PramodDutta/qaskills · 29 tokens

api-rate-limit-handler

Implement bounded, idempotency-aware API throttling, backoff, and retry handling for 429 and transient 5xx responses.

sickn33/agentic-awesome-skills · 32 tokens