← 返回
未分类 中文

Ratelimiter

In-memory sliding window rate limiter for AI agents. Create rate limits per API key, check quota before calling, consume requests, reset, and list all limits...
AI代理的内存滑动窗口限流器,支持按API密钥创建限流规则,调用前检查配额、消耗请求、重置以及列出所有限流等
mirni mirni 来源
未分类 clawhub v1.0.0 1 版本 99703.3 Key: 无需
★ 0
Stars
📥 336
下载
💾 0
安装
1
版本
#latest

概述

RateLimiter

Track and enforce rate limits so your agent doesn't get throttled.

Start the server

uvicorn ratelimiter.app:app --port 8012

Create a rate limit

curl -s -X POST http://localhost:8012/v1/limits \
  -H "Content-Type: application/json" \
  -d '{"key": "openai-api", "max_requests": 60, "window_seconds": 60}' | jq

Check before calling

curl -s http://localhost:8012/v1/check/openai-api | jq '.allowed'

Consume after calling

curl -s -X POST http://localhost:8012/v1/consume/openai-api | jq

Returns allowed (true/false), remaining, and retry_after_seconds (how long to wait if exhausted).

List all limits

curl -s http://localhost:8012/v1/limits | jq

Reset quota

curl -s -X POST http://localhost:8012/v1/reset/openai-api | jq

Delete a limit

curl -s -X DELETE http://localhost:8012/v1/limits/openai-api | jq

Endpoints

MethodPathDescription
---------------------------
POST/v1/limitsCreate/update a rate limit
GET/v1/limitsList all rate limits
GET/v1/check/{key}Check if next request is allowed
POST/v1/consume/{key}Use one request from quota
POST/v1/reset/{key}Reset quota to full
DELETE/v1/limits/{key}Delete a rate limit

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 15:17 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

The Agent Testing & Observability Cookbook: Ship Reliable Agent Commerce Systems

mirni
《代理测试与可观测性实践手册》:交付可靠的代理商务系统。面向从业者的代理商务测试与监控实践手册:工具契约...
★ 0 📥 573

Agent Observability Stack: Distributed Tracing, Metrics, and Alerting for Multi-Agent Systems

mirni
Agent 可观测性栈:多代理系统的分布式追踪、指标和告警。为代理商务构建完整的可观测性栈:OpenT...
★ 0 📥 564

Agent Workforce Orchestration: Hybrid Human+AI Teams

mirni
代理工作力编排:人机混合团队。构建代理主导的工作力编排系统:能力匹配、人工智能代理的托管支付...
★ 1 📥 545