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:
- Read the remaining count and slow down before you reach zero.
- On
429, waitRetry-Afterseconds. - On
500and502, back off exponentially with jitter. - 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.
Related
Frequently asked questions
What is rate limiting?
What should a client do when it gets a 429?
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?
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