How to Size API Rate Limits: a worked example

Rate limits are easiest to set when you work backwards from load. This walk-through uses one example from start to finish. You can run the same steps with your own numbers in the free API Rate Limit Planner, and check your pricing with the API price calculator.

Step 1: Start from daily volume

Take daily active users (DAU) and API calls per user per day.

DAU                 = 1,000
calls per user/day  = 50
daily requests      = 1,000 x 50 = 50,000

Step 2: Convert to an average rate

Spread the daily total over 86,400 seconds.

average req/s = 50,000 / 86,400 = 0.58 req/s

Step 3: Apply a peak factor

Traffic is not flat. If your busiest hour carries a larger share of the day than an even spread would (for example, 3x the average), multiply:

peak req/s = 0.58 x 3 = 1.74 req/s

Round up to a clean number with headroom, such as 3 req/s per key. Set the limit above normal peaks but well below what your backend can absorb.

Step 4: Pick tiers from the same arithmetic

Each pricing tier is a different per-key rate and a monthly volume. A free tier might allow 1 req/s and 100,000 requests a month; a paid tier 10 req/s and several million. Check each tier's monthly volume against the same formula:

monthly requests = DAU x calls per user/day x 30

If a heavy user at the top of your tier can exhaust your monthly budget in a few days, lower the tier's monthly cap or raise its price.

Step 5: Return useful headers

Clients behave better when they can see their limit. Common practice is to return X-RateLimit-Limit, X-RateLimit-Remaining and Retry-After on a 429 response, so a client can back off without guessing.

Checklist

These are rules of thumb, not a substitute for measuring your own traffic. Free to use and share.

Want the full worksheet? Get the full API Pricing Worksheet - 0.003 ETH. It is a fill-in file for pricing a small public API, delivered by email after payment.