Track and enforce rate limits so your agent doesn't get throttled.
bash
uvicorn ratelimiter.app:app --port 8012
bash
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
bash
curl -s http://localhost:8012/v1/check/openai-api | jq '.allowed'
bash
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).
bash
curl -s http://localhost:8012/v1/limits | jq
bash
curl -s -X POST http://localhost:8012/v1/reset/openai-api | jq
bash
curl -s -X DELETE http://localhost:8012/v1/limits/openai-api | jq
MethodPathDescriptionPOST/v1/limitsCreate/update a rate limitGET/v1/limitsList all rate limitsGET/v1/check/{key}Check if next request is allowedPOST/v1/consume/{key}Use one request from quotaPOST/v1/reset/{key}Reset quota to fullDELETE/v1/limits/{key}Delete a rate limit