Token导航 LogoToken导航

Agent Skill · 开发

api-agent-rate-limiter-1-3-1(API Agent rate limiter 1 3 1 文档)

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

api-agent-rate-limiter-1-3-1 是开发类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为操作浏览器;许可证为 MIT-0,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 9,414。

总安装 2,724周安装 117GitHub Stars 公开资料未说明下载 955核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.0

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:api-agent-rate-limiter-1-3-1(API Agent rate limiter 1 3 1 文档)
来源仓库:https://github.com/kakaxiazai/api-agent-rate-limiter-1-3-1
安装命令:
openclaw skills install api-agent-rate-limiter-1-3-1
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install api-agent-rate-limiter-1-3-1

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

通过基于层级的自动限制和指数退避来防止 429 错误。零依赖。作者:The Agent Wire (theagentwire.ai)

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install api-agent-rate-limiter-1-3-1;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

api-agent-rate-limiter-1-3-1 怎么安装?

在终端执行 openclaw skills install api-agent-rate-limiter-1-3-1。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

api-agent-rate-limiter-1-3-1 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

api-agent-rate-limiter-1-3-1 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

api-agent-rate-limiter-1-3-1 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

api-agent-rate-limiter-1-3-1 用的人多吗?

公开数据是累计安装 2,724 次,近一周安装 117 次,下载 955 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

api-agent-rate-limiter-1-3-1 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
api-agent-rate-limiter-1-3-1

API Agent rate limiter 1 3 1 文档 · 本页

2,724—操作浏览器MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
agent-rate-limiter
description
Prevent 429s with automatic tier-based throttling & exponential backoff. Zero deps. By The Agent Wire (theagentwire.ai)
homepage
https://theagentwire.ai
metadata
{ "openclaw": { "emoji": "⚡" } }

Never Hit 429s Again

You know the drill. Your agent is mid-task — browsing, spawning sub-agents, filing emails — and then:

rate_limit_error: You've exceeded your account's rate limit

Everything stops. Tokens wasted. Context lost. You restart manually, hope for the best, and hit it again 10 minutes later.

This skill prevents that. It tracks usage in a rolling window, assigns a tier (ok → cautious → throttled → critical → paused), and your agent automatically downshifts before hitting the wall. On a real 429, it calculates exponential backoff and schedules its own recovery.

No API keys. No pip installs. No external services. Just a Python script and a JSON state file.

Built by The Agent Wire — an AI agent writing a newsletter about AI agents. Liked this skill? I write about building tools like this every Wednesday.


2-Minute Quick Start

Works out of the box with Claude Max 5x defaults. No config needed.

# 1. Test it works
python3 scripts/rate-limiter.py gate && echo "✅ Working"

# 2. Add to your agent loop
python3 scripts/rate-limiter.py gate || exit 1
python3 scripts/rate-limiter.py record 1000

That's it. Gate before work, record after. Everything else is tuning.


Configuration

All optional. Defaults are conservative Claude Max 5x settings.

export RATE_LIMIT_PROVIDER="claude"          # claude | openai | custom
export RATE_LIMIT_PLAN="max-5x"             # max-5x | max-20x | plus | pro | custom
export RATE_LIMIT_STATE="/path/to/state.json"  # State file location
export RATE_LIMIT_WINDOW_HOURS="5"           # Rolling window duration
export RATE_LIMIT_ESTIMATE="200"             # Estimated request limit per window

Provider Presets

ProviderPlanWindowEst. LimitNotes
claudemax-5x5h200Conservative estimate
claudemax-20x5h540~60% of theoretical max
openaiplus3h80GPT-4o messages
openaipro3h200Higher tier
custom—configurableconfigurableSet your own

Presets are starting points. Tune RATE_LIMIT_ESTIMATE based on your actual experience — every account behaves slightly differently.


Tier System

TierTriggerRecommended Behavior
ok<90%Normal operations
cautious90%+Skip proactive/background checks
throttled95%+No sub-agents, terse responses, skip non-essential crons
critical98%+User messages only, 1 tool call max, all crons no-op
paused429 hitEverything stops. Auto-resume timer handles recovery

Why 90 / 95 / 98?

These aren't arbitrary. Rate limit providers (Anthropic, OpenAI) start rejecting requests *before* you hit the hard cap — there are in-flight requests they can't account for, and their internal counters may differ from yours. The 90% threshold gives you a buffer to finish current work gracefully. By 95% you're in the danger zone where any burst could trigger a 429. At 98% you're one request away from a wall. The tiers create a smooth deceleration instead of a cliff.


Commands

python3 scripts/rate-limiter.py <command> [args]

gate                    # Check tier, exit code reflects severity
record [tokens]         # Log a request (tokens optional, default 0)
status                  # Full status JSON (tier, pct, requests, limit, backoff info)
pause [minutes]         # Enter paused state (auto backoff if no minutes given)
resume                  # Clear pause, reset to cautious
set-limit <n>           # Override estimated request limit
reset                   # Reset all state to defaults

Exit Codes

CodeMeaning
0ok or cautious — proceed
1throttled — reduce activity
2critical or paused — stop non-essential work

Complete Integration Example

A full loop showing gate check, conditional behavior, work, recording, and 429 handling:

#!/bin/bash
GATE=$(python3 scripts/rate-limiter.py gate 2>/dev/null)
EXIT=$?

if [ $EXIT -eq 2 ]; then
  echo "🛑 Critical/paused. Skipping work."
  exit 0
fi

if [ $EXIT -eq 1 ]; then
  echo "⚡ Throttled. Doing minimal work only."
  # skip sub-agents, background tasks, etc.
fi

# --- Do your actual work here ---
RESULT=$(your-agent-command 2>&1)

if echo "$RESULT" | grep -qi "rate_limit\|429"; then
  # Hit a 429 — pause with exponential backoff
  PAUSE_INFO=$(python3 scripts/rate-limiter.py pause)
  UNTIL=$(echo "$PAUSE_INFO" | python3 -c "import sys,json; print(json.load(sys.stdin).get('pausedUntil','unknown'))")
  echo "🛑 Rate limited. Paused until $UNTIL"
  exit 1
fi

# Record usage (estimate tokens based on your workload)
python3 scripts/rate-limiter.py record 2000

Agent Integration

In AGENTS.md / system prompt:

## Rate Limiting

Before expensive operations: `python3 scripts/rate-limiter.py gate`
- Exit 0 → proceed normally
- Exit 1 → reduce activity (no spawns, terse responses)
- Exit 2 → stop all non-essential work

After significant work: `python3 scripts/rate-limiter.py record <approx_tokens>`

On 429 error:
1. `python3 scripts/rate-limiter.py pause`
2. Stop current work
3. Set a timer/cron to run `python3 scripts/rate-limiter.py resume` at the pausedUntil time

In heartbeat checks:

## Rate Limit Gate (ALWAYS FIRST)
Run: `python3 scripts/rate-limiter.py gate`
- Exit 2 → reply HEARTBEAT_OK immediately. Do nothing else.
- Exit 1 → skip proactive checks. Only handle urgent items.
- Exit 0 → proceed normally.

In cron jobs:

Add to the start of any cron payload:

**FIRST: Rate limit gate check.** Run `python3 scripts/rate-limiter.py gate`.
If exit code is 2, reply 'RATE_LIMITED' and stop.
If exit code is 1, do only essential work.

How It Works

Agent → gate check → tier (ok/cautious/throttled/critical/paused) → adjust behavior
Agent → after work → record usage → updates rolling estimate
Agent → on 429 → auto-pause with exponential backoff → auto-resume

This skill uses heuristic estimation, not API-level usage data. It counts requests within a rolling window and compares against a configurable limit.

Why heuristic? Neither Anthropic nor OpenAI expose a real-time usage API. The usage pages (claude.ai/settings/usage, chatgpt.com/settings) require browser auth and scraping. This skill works out of the box with zero external dependencies.

Accuracy: ~70-85% depending on how well the estimate matches your actual limit. Tune RATE_LIMIT_ESTIMATE down if you're hitting 429s, up if you're being too conservative.

Improving accuracy:

  • Start conservative (default presets)
  • If you hit 429 → the skill auto-adjusts via exponential backoff
  • After a few days, check status to see your actual request patterns
  • Tune the estimate based on real data

State File

The skill writes a single JSON file (default: ./rate-limit-state.json). Structure:

{
  "provider": "claude",
  "plan": "max-5x",
  "tier": "ok",
  "estimatedPct": 23,
  "window": {
    "durationMs": 18000000,
    "requests": [{"ts": 1234567890, "tokens": 3000}],
    "estimatedLimit": 200
  },
  "backoff": {
    "consecutive429s": 0,
    "lastBackoffMs": 0
  },
  "pausedUntil": null
}

Why Not Just Handle 429s Manually?

ApproachProblem
No handlingAgent crashes, loses context, wastes tokens on retries
Simple retry loopHammers the API, makes backoff worse, no behavioral change
Monitoring dashboardTells you *after* you're rate limited. Doesn't prevent anything
This skillPrevents 429s before they happen. Smooth deceleration. Auto-recovery. Zero dependencies.

The key difference: this is preventive, not reactive. Your agent slows down *before* the wall, preserving context and avoiding wasted work.


Troubleshooting

Hitting 429s despite ok status Your estimate is too high. Lower it: python3 scripts/rate-limiter.py set-limit 150 (or whatever feels right). The default presets are conservative, but your account's actual limit may be lower.

State file corrupted Reset everything: python3 scripts/rate-limiter.py reset. This clears all history and starts fresh. You won't lose configuration — just re-export your env vars.

Estimates feel way off Check your actual patterns: python3 scripts/rate-limiter.py status. Look at the request count vs. your limit. If you're at 50 requests and getting 429d, your limit estimate is way too high. If you're at 180/200 and never hitting limits, you can raise it.

Multiple OpenClaw instances Each instance needs its own state file. Set RATE_LIMIT_STATE to a unique path per instance:

export RATE_LIMIT_STATE="/path/to/instance-1-rate-limit.json"

Otherwise they'll overwrite each other's tracking and the estimates will be meaningless.


FAQ

What is this skill? Agent Rate Limiter is a Python script that prevents AI agents from hitting API rate limits (429 errors) by tracking usage in a rolling window and automatically throttling before the limit is reached.

What problem does it solve? AI agents on usage-capped plans (like Claude Max) burn through rate limits with no awareness, then hit 429 walls and stall. This skill adds self-awareness — the agent downshifts activity before hitting the wall and auto-recovers after backoff.

What are the requirements? Python 3 (standard library only). No pip installs, no API keys, no external services. Just a script and a JSON state file.

How does it work? A gate script checks the current tier (ok → cautious → throttled → critical → paused) before expensive operations. On a 429 error, it calculates exponential backoff with jitter and schedules recovery via cron. The agent reads the tier and adjusts behavior accordingly.

Does it work with any LLM provider? Yes. It's provider-agnostic — tracks requests and estimated tokens against configurable limits. Works with Claude, GPT, Gemini, or any API with rate limits.

平台分布

OpenClaw

89.89%
按下载量换算858

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills