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.
npx skills add latestaiagents/agent-skills --skill llm-rate-limitinggit clone --depth 1 https://github.com/latestaiagents/agent-skillsWrote 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.
[](https://agentmods.dev/skills/latestaiagents/agent-skills/llm-rate-limiting)<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/llm-rate-limiting"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/llm-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.
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/llm-rate-limiting"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/llm-rate-limiting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00049 | $0.02672 |
| Opus 5.5 | $0.00020 | $0.01069 |
| Sonnet 5.5 | $0.00010 | $0.00534 |
| Haiku 4.5 | $0.00005 | $0.00267 |
Grade A, and why
llm-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 2d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 449 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LLM Rate Limiting
Implement robust rate limiting to prevent quota exhaustion and handle API limits gracefully.
When to Use
- Hitting API rate limits
- Managing concurrent requests
- Preventing quota exhaustion
- Implementing fair usage policies
- Handling burst traffic
API Rate Limits
Rate limits depend on your provider, usage tier, model, and sometimes region, and providers change them. Read the current values from the official pages and from response headers instead of hard-coding them:
| Provider | Official rate-limit docs | Runtime signal |
|---|---|---|
| Anthropic | https://platform.claude.com/docs/en/api/rate-limits | anthropic-ratelimit-* response headers, retry-after on 429 |
| OpenAI | https://platform.openai.com/docs/guides/rate-limits | x-ratelimit-* response headers |
The tables below are an illustrative shape only (made-up numbers) showing the dimensions to configure: requests per minute, input/output tokens per minute, per tier.
| Tier | Requests/min | Input tokens/min | Output tokens/min |
|---|---|---|---|
| Example tier A | 50 | 30K | 8K |
| Example tier B | 1,000 | 450K | 90K |
Rate Limiter Implementation
Token Bucket Algorithm
class TokenBucket {
private tokens: number;
private lastRefill: number;
constructor(
private capacity: number, // Max tokens
private refillRate: number, // Tokens per ms
) {
this.tokens = capacity;
this.lastRefill = Date.now();
}
private refill(): void {
const now = Date.now();
const elapsed = now - this.lastRefill;
const newTokens = elapsed * this.refillRate;
this.tokens = Math.min(this.capacity, this.tokens + newTokens);
this.lastRefill = now;
}
async acquire(tokens: number = 1): Promise<boolean> {
this.refill();
if (this.tokens >= tokens) {
this.tokens -= tokens;
return true;
}
return false;
}
async waitForTokens(tokens: number = 1): Promise<void> {
while (!(await this.acquire(tokens))) {
const waitTime = (tokens - this.tokens) / this.refillRate;
await sleep(Math.min(waitTime, 1000)); // Max 1 second wait
}
}
}
// Usage
const limiter = new TokenBucket(
1000, // 1000 tokens capacity
1000 / 60000 // 1000 tokens per minute = ~16.67 per second
);
async function makeRequest() {
await limiter.waitForTokens(1);
return callAPI();
}
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.
- 2d ago Changed · -6 lines 70f0819260eb
- 2mo ago First seen · 455 lines · 49 tokens per session scan A 55275d3a24bf
llm-rate-limiting is a skill published in the GitHub repository latestaiagents/agent-skills (6 stars, last pushed 2d ago), licensed MIT. It adds 49 tokens to every session and 2,672 once invoked, about $0.0002 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.
llm-rate-limiting compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| llm-rate-limitinglatestaiagents/agent-skills | Skill | 6 | 2d ago | MIT | A | 49 | Claude Code |
| fw-ai-actions-appfreshworks-developers/fw-dev-tools | Skill | 6 | 1mo ago | MIT | A | 123 | Claude Code |
| ai-enterprise-ai-usecase-priority-assessmentskillsaiagent/aiskills | Skill | 5 | 5mo ago | none | A | 79 | Codex |
| neuron-agentneuron-core/neuron-ai | Skill | 2.2k | yesterday | MIT | A | 48 | Claude Code, Codex |
| mem0-integrationa5c-ai/babysitter | Skill | 1.9k | 5d ago | MIT | A | 27 | Claude Code |
| moai-ref-api-patternsmodu-ai/moai-adk | Skill | 1.3k | 4d ago | Apache-2.0 | A | 85 | Claude Code |
| llm-classifiera5c-ai/babysitter | Skill | 1.9k | 5d ago | MIT | A | 18 | Claude Code |