Skip to content

Glossary

Rate limiting: capping requests over time

Rate limiting caps how many requests a client can make in a time window, answered with HTTP 429 and Retry-After. How it works and how to handle it in code.

Updated 2026-11-23

Rate limiting restricts how often a client can call a service. A limit might be a fixed number of requests per time window per API key, per account or per IP address. Beyond it, requests are refused until the window moves on. It protects capacity and makes abuse slower and more expensive.

How it works

Common algorithms:

Algorithm Idea
Fixed window A counter per interval, reset at its end
Sliding window Counts requests in the last N seconds
Token bucket Tokens refill at a steady rate, each request spends one, short bursts are allowed
Leaky bucket Requests drain at a constant rate

When a client exceeds the limit, the server answers 429 Too Many Requests (RFC 6585), commonly with Retry-After (RFC 9110), which says how many seconds to wait. Many services also publish counters in headers.

The Qelka API shows the pattern. Each key can send 200 requests per 10 seconds, and each organization 1,000 per 60 seconds. Responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refusal is 429 with the error type rate_limited and a Retry-After header. A refused call is not billed. The details are in rate limits and errors.

Client-side rules:

  1. Read the remaining count and slow down before you reach zero.
  2. On 429, wait Retry-After seconds.
  3. On 500 and 502, back off exponentially with jitter.
  4. Do not retry errors that fail the same way each time.

Server-side rules for your own product:

  • Choose the key carefully. A limit per IP alone fails against rotating addresses and punishes shared ones, such as a mobile network or an office. Limit per account, per phone number and per email too.
  • Return clear errors, never a silent drop.
  • Set stricter limits on costly or sensitive actions.

Why it matters for validation

Limits are the second line of defense behind validation. A check can tell you a number is a premium-rate number or an IP is a datacenter address, but a patient attacker with clean-looking inputs still needs to be slowed down.

Useful limits around a signup flow:

Action Limit by
Send a verification code Phone number, account, IP
Signup IP network, device, email domain
Password attempts Account
Calls to a validation API API key

Validate before you spend: check the phone line type and the email status before you send a code, so a limited budget of messages goes to plausible recipients. Combine limits with a fraud score and tighten them when the score is high.

For batch work, see the batch and bulk endpoints, which exist to avoid thousands of single calls.

Frequently asked questions

What is rate limiting?
Rate limiting restricts how many requests a client may send to a service in a given period, for example a number per ten seconds. When the client goes over, the server refuses with HTTP status 429, Too Many Requests, defined in RFC 6585, and often says how long to wait. It protects the service from overload and abuse.
What should a client do when it gets a 429?
Wait for the number of seconds in the Retry-After header, then retry. If there is no header, back off exponentially with some random jitter so that many clients do not return together. Do not retry in a tight loop, and slow down before you hit the limit by reading the remaining count.
How does rate limiting help against fraud?
It makes bulk abuse expensive. Limits on code requests, signups and logins per account, per phone number and per IP slow down credential stuffing, SMS pumping and fake account creation. They work best per identity, since attackers rotate IP addresses.

Put this check in your product

Get an API key in under a minute. 100 free credits every month, no card required.

  • 100 free credits a month
  • No card
  • Test keys spend nothing
  • Cancel any time