SaaS API Rate Limiting Without Breaking Integrations
A practical guide to SaaS API rate limiting: choose the limit key, return a clear 429 contract, roll limits out in shadow mode and watch usage per tenant.

SaaS API rate limiting is the set of rules that decides how many requests each customer, integration or user may send to your API in a given time, and what happens when they send more. Done well, it stops one customer's runaway sync from slowing everyone else. The controls buyers check before signing are covered in our related guide on SaaS security; this article treats limits as a reliability and fairness control for customers' integrations, not only an abuse defence.
Which plan gets how many requests is a pricing question for our article on SaaS feature entitlements. Here we cover how limits are enforced.
Key Takeaways
- Rate limits share capacity fairly between tenants, protect shared infrastructure and cap running costs, as well as slowing abusive traffic.
- Count requests per tenant and per integration first, then add tighter limits for expensive endpoints and per-IP limits for unauthenticated traffic.
- Return HTTP 429 with a Retry-After header and documented limit headers, so client code can slow down without a support ticket.
- Measure in log-only mode and publish headers before enforcing anything against existing integrations.
Why Do SaaS APIs Need Rate Limits?
Rate limits exist because every tenant in a multi-tenant product draws on the same databases, workers and third-party services. One bulk import or looping script can consume capacity other customers pay for, the noisy-neighbour problem in our article on multi-tenant SaaS architecture.
Cost is the second reason. The OWASP API Security Top 10 2023 lists Unrestricted Resource Consumption as API4, warning of denial of service and higher operational costs, including third-party services such as SMS paid per request. Its prevention advice includes limiting how often a client can interact with the API.
Which Key Should a Rate Limit Count Against?
The limit key decides whose requests are counted together, and the wrong key punishes the wrong customer. RFC 6585 leaves this choice to you, because it does not define how the server identifies the user or counts requests.
- Per tenant: the fairness boundary, so one account cannot crowd out another however many keys it holds.
- Per API key or integration: a customer's ERP sync and reporting tool get separate allowances.
- Per endpoint class: tighter limits on search, exports, bulk writes and anything that triggers a paid third-party call.
- Per IP address: only for unauthenticated routes such as sign-in, because many customers can share one corporate or cloud address.
Requests usually pass more than one layer. GitHub, for example, ties unauthenticated requests to the originating IP address.
Token Bucket and Window Algorithms in Plain Terms
The algorithm decides how bursts are treated, which matters more to integrators than the headline number.
- Token bucket: a bucket refills at a steady rate, each request takes a token, and the bucket size sets the largest burst. Amazon API Gateway describes a steady-state rate plus a burst limit it calls the maximum bucket size.
- Fixed window: count per clock minute and reset at the boundary, so a client can spend a full allowance just before the reset and another just after.
- Sliding window: count over the most recent stretch of time, which smooths that boundary effect.
Set burst and sustained rate separately, because a nightly sync may need a short burst well above its average.
What Should the 429 Response Contract Say?
The response contract is what integrators build code against, so write it down and keep it stable.
- Status code: RFC 6585 defines 429 Too Many Requests for a user who has sent too many requests in a given amount of time, and says the response should explain the condition.
- Retry-After: RFC 9110 says servers send Retry-After to indicate how long the user agent ought to wait, as an HTTP-date or a number of seconds. Send it on every 429.
- Allowance headers: GitHub returns headers such as x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset, and Stripe adds a Stripe-Rate-Limited-Reason header to throttled responses.
- Emerging standard: the IETF RateLimit header fields draft defines RateLimit-Policy and RateLimit fields. It is still an Internet-Draft, which the IETF says should be cited only as work in progress.
Keep other 429s distinguishable. Stripe notes that a 429 without its rate-limit headers might be a lock timeout, and GitHub may answer an exceeded limit with 403 or 429, so document exactly which codes clients will see.
What Should Integrators Do After a 429?
Client guidance belongs in your API documentation.
- Honour Retry-After: wait at least the stated time, and never retry in a tight loop.
- Back off with jitter: the AWS Builders' Library article on timeouts, retries and backoff with jitter explains that clients retrying together recreate the overload, and that jitter adds randomness to spread retries out.
- Send idempotency keys on writes: Stripe's documentation on idempotent requests explains that a client-generated key lets a request be repeated without creating a second object.
Wider connector design is covered in our guide to software integration services.
SaaS API Rate Limiting Decision Workflow
Work through these decisions in order for each API surface, recording an answer the team can test.
- 1. Classify the caller: integration, interactive user or unauthenticated visitor. Done when every route maps to one class.
- 2. Pick the key and cost: tenant plus integration by default, and whether a bulk request costs several units. Done when the cost rules are in the API docs.
- 3. Set burst and sustained values from data: use shadow-mode logs; for example, start above the busiest tenant's observed peak. Done when no current tenant would be rejected on a normal day.
- 4. Choose the over-limit action: reject with 429, queue the work, or return smaller pages. Done when each route has one documented action.
- 5. Define exceptions: who can grant a temporary raise and who reviews it. Done when every exception has an owner and an expiry date.
- 6. Source the values: enforcement reads limits from plan entitlements, not hard-coded numbers. Done when a plan change alters the limit without a release.
Edge Cases to Decide Up Front
- Several app servers: counters in each server's memory let a client multiply its allowance, so keep them in a shared store or at the gateway.
- Batched requests: OWASP's API4 example shows a rate-limited GraphQL endpoint bypassed by batching many operations in one request, so count operations, not only HTTP calls.
- Your own front end: give the web app a user-level limit so one buggy browser tab cannot drain the tenant's integration allowance.
How Do You Roll Out Limits Without Breaking Integrations?
Introduce limits as a staged rollout, because existing integrations were written against an API that never refused them.
- Log-only mode: record what would have been rejected, per tenant and key, without rejecting anything.
- Publish headers: return allowance headers on normal responses so integrators see where they stand.
- Give notice: send technical contacts the limits, the 429 contract and the enforcement date.
- Contact outliers: tenants who would be rejected get a direct note and, where justified, an exception with an expiry date.
- Enforce in steps: start with new keys or one endpoint class, then extend.
Outbound webhooks reverse the roles, because your SaaS becomes the client of a customer's endpoint. Cap concurrent deliveries per endpoint, honour the receiver's 429 and Retry-After, retry with backoff and jitter, and include an event ID so receivers can discard duplicates.
What Should Monitoring and Support Show?
A limit nobody watches becomes a support ticket saying the API is broken.
- 429 rate per tenant and per key, compared with each one's normal baseline.
- Near-limit alerts when a tenant sustains a high share of its allowance, for example 80 percent for an hour (an illustrative threshold).
- A support view showing a tenant's current usage, limits, active exceptions and recent 429 responses.
Alert routing and dashboard design are covered in our guide to SaaS observability.
Stakeholder Questions and Acceptance Criteria
Before enforcement, the product owner names the affected customers, and the development lead decides whether the API fails open or closed if the counter store is down. Enforcement is accepted only when every item below is true.
- Shadow mode has run for an agreed period and its report names every tenant that would have been rejected.
- An automated test confirms every 429 carries Retry-After and a distinct error code.
- A test client cannot exceed its allowance by spreading requests across two app servers.
- A test integration following the documented backoff completes a bulk job with zero duplicate writes.
- Every exception has an expiry date, and integrators received notice before the enforcement date.
For an early product, the SaaS MVP development stage is the cheapest time to add a tenant-level limit and the 429 contract. The same gate applies to custom industry business systems that expose APIs to suppliers or customers' own software.
Related Resources
- RFC 6585 status codes
- OWASP API4 resource consumption
- GitHub REST API rate limits
- Stripe rate limits
- Amazon API Gateway throttling
- our SaaS security guide
Answers for Calmer API Integrations
1. What Is SaaS API Rate Limiting?
It is the set of rules that caps how many requests a tenant, integration, user or IP address can send to a SaaS API in a period, and defines the response when a caller goes over.
2. Which HTTP Status Code Should a Rate-Limited API Return?
RFC 6585 defines 429 Too Many Requests for this case and says it may include a Retry-After header. GitHub documents that an exceeded limit can return 403 or 429, so check each provider's documentation.
3. Is the RateLimit Header an Official Standard?
Not yet. The RateLimit and RateLimit-Policy fields are defined in an IETF Internet-Draft, which the IETF says should be cited only as work in progress.
4. How Should a Client Retry After a 429 Response?
Wait at least as long as the Retry-After header says, then retry with capped exponential backoff, random jitter and a fixed maximum number of attempts, sending an idempotency key on writes.
Limits Should Protect Customers, Not Surprise Them
Choose keys that match tenancy, return a 429 contract integrators can code against, and measure in shadow mode before enforcing. That order keeps a shared SaaS product fair without breaking the integrations customers rely on.


