llm-rate-limiting

llm-rate-limiting is a skill for Claude Code from latestaiagents/agent-skills. It costs 49 tokens per session (2,672 once invoked), scanned A, original, MIT.

A guide for controlling how often an application sends requests to large language model (LLM) APIs. It covers quota limits, retry backoff, concurrent requests, fair usage, and burst traffic.

In plain words
What is it for?
Use it when building or fixing request throttling, retry handling, or concurrency control for LLM services.
Why use it?
It helps prevent requests from being rejected when an API limit is reached or when too many requests arrive at once. It also helps avoid exhausting an API quota.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the mlops plugin — 7 skills shipped together , and of llmops-guardian, latestaiagents

Good fit Use it when building or fixing request throttling, retry handling, or concurrency control for LLM services.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/latestaiagents/agent-skills/llm-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 latestaiagents/agent-skills --skill llm-rate-limiting
Clone the repo
git clone --depth 1 https://github.com/latestaiagents/agent-skills

Made for: Claude Code.

Or install mlops, the plugin that ships this one along with the rest of its 7 skills.

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 llm-rate-limiting

README.md
[![agentmods](https://agentmods.dev/badge/skills/latestaiagents/agent-skills/llm-rate-limiting/github.svg)](https://agentmods.dev/skills/latestaiagents/agent-skills/llm-rate-limiting)
Your own site
<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.

agentmods 80×15 button for llm-rate-limiting

Your own site · 80×15
<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>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,672 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.
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.00049 $0.02672
Opus 5.5 $0.00020 $0.01069
Sonnet 5.5 $0.00010 $0.00534
Haiku 4.5 $0.00005 $0.00267

Measured 2d ago against content hash 70f0819260eb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

skills/mlops/llmops-guardian/llm-rate-limiting/SKILL.md · 449 lines

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();
}

Read the full file on GitHub · 449 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. 2d ago Changed · -6 lines 70f0819260eb
  2. 2mo ago First seen · 455 lines · 49 tokens per session scan A 55275d3a24bf

Subscribe to this mod's changes

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.

Related

llm-rate-limiting compared with skills from other repositories

llm-rate-limiting next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
llm-rate-limitinglatestaiagents/agent-skillsSkill62d agoMITA49Claude Code
fw-ai-actions-appfreshworks-developers/fw-dev-toolsSkill61mo agoMITA123Claude Code
ai-enterprise-ai-usecase-priority-assessmentskillsaiagent/aiskillsSkill55mo agononeA79Codex
neuron-agentneuron-core/neuron-aiSkill2.2kyesterdayMITA48Claude Code, Codex
mem0-integrationa5c-ai/babysitterSkill1.9k5d agoMITA27Claude Code
moai-ref-api-patternsmodu-ai/moai-adkSkill1.3k4d agoApache-2.0A85Claude Code
llm-classifiera5c-ai/babysitterSkill1.9k5d agoMITA18Claude Code