Skip to main content

Rate Limit Calculator

Enter your RPM limit and burst size to get the optimal token bucket configuration, per-worker delay, refill time, and ready-to-use code snippets for Express, Nginx, and Cloudflare Workers.

✓ Token bucket config ✓ Multi-worker delay ✓ Express / Nginx / Cloudflare snippets

Configuration

req/min
e.g. OpenAI = 10000, GitHub = 5000
tokens
Max requests sent instantly
workers
Shared rate limit across all
Quick Presets

Frequently Asked Questions

What is a token bucket algorithm?▼

A token bucket is the most common rate limiting algorithm. The bucket holds a maximum number of tokens (burst size). Tokens are added at a fixed rate (RPM / 60 = tokens/sec). Each request consumes one token. When the bucket is empty, requests are rejected or queued. This allows short bursts while enforcing a long-term rate limit.

What is the difference between RPM and RPS?▼

RPM (requests per minute) and RPS (requests per second) both measure API throughput. RPM = RPS × 60. Most rate limit docs use RPM (e.g., OpenAI: 10,000 RPM). When calculating delays between requests, convert to per-second: delay = 1000ms / RPS.

How do I avoid hitting rate limits with multiple workers?▼

Divide your RPM by the number of concurrent workers. Each worker should wait at least (60,000ms / RPM) × workers between requests. Use a shared queue or Redis-based rate limiter (e.g., bottleneck, p-throttle) so workers coordinate instead of each maintaining their own timer.

What is burst size and why does it matter?▼

Burst size is the maximum number of requests you can send instantly before the rate limit kicks in. For a 60 RPM limit with burst=10, you can send 10 requests immediately, then must wait ~1 second per additional request. Larger burst sizes are useful for handling traffic spikes without queuing.

What is the refill time for an empty token bucket?▼

If you fully exhaust a token bucket (burst size = N), the refill time is N × (60,000ms / RPM). For example, a 60 RPM limit with 10-token burst: refill = 10 × 1000ms = 10 seconds. The bucket is fully replenished after 10 seconds of no requests.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Mar 27, 2026 · 15 min read

API Rate Limiting: Algorithms and Implementation Guide 2026

Complete guide to API rate limiting in 2026. Token Bucket, Leaky Bucket, Sliding Window algorithms with Node.js and Redis implementations, distributed rate limiting, 429 handling, and best practices.

Mar 21, 2026 · 13 min read

API Rate Limiting: Strategies, Algorithms, and Free Tools

A complete guide to API rate limiting in 2025: Fixed Window, Sliding Window, Token Bucket, and Leaky Bucket algorithms explained, with implementation in Node.js, Python, and Go, Redis-based distributed limiting, and client-side backoff strategies.

Apr 4, 2026 · 13 分鐘

Docker Compose 開發環境架設:前端、後端、資料庫一鍵啟動

用 Docker Compose 建立完整的本地開發環境,包含 React 前端、Node.js 後端、PostgreSQL 資料庫,一個指令啟動所有服務,告別「在我電腦上可以跑」的問題。

Apr 2, 2026 · 11 min read

Nginx Configuration Guide for Web Developers 2026: Reverse Proxy, SSL & Performance

Master Nginx configuration in 2026. Complete guide covering reverse proxy setup, SSL/TLS with Let's Encrypt, gzip compression, caching, rate limiting, load balancing, and common gotchas.

Apr 1, 2026 · 15 min read

Cloudflare Workers & Wrangler v4 Complete Guide 2026

Complete guide to Cloudflare Workers and Wrangler v4 in 2026. Learn wrangler.toml configuration, Workers vs Pages, KV/R2/D1 bindings, environment management, local development with miniflare, and production deployment pipelines.

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →