API Rate Limit Calculator

Token Bucket / Leaky Bucket / Sliding Window

Rate (req/s)
Bucket Capacity / Window Size
Burst Requests
Time Window (s)

API Rate Limiting Algorithm Guide

Algorithm Comparison

  • Token Bucket — Allows burst traffic, adds tokens at a constant rate
  • Leaky Bucket — Smooths output, strictly controls processing rate
  • Fixed Window — Simple counter, has boundary burst issues
  • Sliding Window — Smooth counting, avoids boundary bursts

Use Cases

  • API Gateway rate limiting (Nginx, Kong)
  • User-level / IP-level rate limiting
  • Third-party API call quota calculation
  • Microservice traffic control