Learning center

Third-party API returns 429 or 503: your quota or their outage?

A 429 from a provider's API says you sent too many requests for the limit it applies to you; a 503 says the server cannot handle requests right now. Read the response headers and check who else fails: a 429 that only your key gets is your quota, a 503 that every caller gets is the provider, and a 503 without the provider's own headers may come from your own egress path.

Three sources for the same failed call#

An outbound call from payments to a provider fails, and the log shows only a status code. Three different owners can produce it:

  • The provider's rate limiter. RFC 6585 defines 429 Too Many Requests for a user who has sent too many requests in a given amount of time. The response may carry Retry-After, and the RFC leaves open how the server identifies the user and counts requests: per key, per account, per resource or across servers. RFC 6585, section 4
  • The provider's own trouble. RFC 9110 defines 503 Service Unavailable for a server currently unable to handle the request because of temporary overload or maintenance, also with an optional Retry-After. Providers also use these codes for each other's meaning: Amazon S3 answers an excessive request rate with 503 Slow Down, and GitHub answers an exhausted rate limit with 403 or 429, so the code alone is not decisive. RFC 9110, 503 · S3 error codes
  • Your side of the path. An egress proxy, service mesh sidecar or API gateway between you and the provider can generate its own 503 when it cannot reach the upstream, and a NAT or proxy problem can fail the call with no status at all. Requests with no status · Proxy variables on internal calls

Servers are not required to use 429. RFC 6585 notes that a server under heavy load from one party may simply drop connections instead. RFC 6585, section 7.2

This guide is one of a set on runtime dependency failures.

Why they look alike#

Client libraries often fold 429 and 503 into one retryable error, and retries hide the original response. Both can carry Retry-After. Both rise when your traffic rises, because more traffic both spends a quota faster and makes a struggling provider fail more often. The useful facts are in the headers you may not be logging, and in whether the failure is yours alone.

Read the response, not the exception#

Retry-After is either an HTTP date or a number of seconds to wait. RFC 9110, Retry-After

Rate-limit headers are provider-specific. GitHub's REST API, for example, sends x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset and x-ratelimit-resource, and answers an exhausted primary limit with 403 or 429 and x-ratelimit-remaining: 0. An IETF draft defines standard RateLimit and RateLimit-Policy fields, but it is still an Internet-Draft, and few providers send them. GitHub REST rate limits · RateLimit header fields draft

Who generated the response shows in Server and Via. Server names the software of the origin server, and Via lists intermediaries that forwarded the message. A 503 whose Server names your own proxy, with no provider request ID, never reached the provider. RFC 9110, Server · RFC 9110, Via

Reproduce one call from the service's network and print only the headers. Pick an inexpensive read endpoint: the request counts against the same quota you are investigating, and a write endpoint would change data.

curl -sS -o /dev/null -D - \
  -H "Authorization: Bearer $API_KEY" \
  https://api.example.com/v1/status

Run it twice: once through the same proxy or egress the service uses, and once from another network or with a second key if your contract provides one. curl -v also shows which address you connected to and whether a proxy was used.

Then read the provider's status page and its incident history for the same window. A posted incident covering your region and endpoint settles the question quickly. A status page shows only what the provider has posted, so a quiet page does not show that the provider is serving your traffic.

Decision table#

ObservationPoints to
429, remaining count at 0, other keys succeedYour quota
429 on every key from every networkA provider-wide limit or provider trouble
503 with provider headers and request ID, from everywhereProvider outage
503 only through your egress, Server is your proxyYour egress path
Failures only from one region or NAT addressYour path, or a regional provider issue
Errors start at your deploy, request count doubledYour traffic spent the quota

For the last row, compare your outbound request rate before and after the change. Retries count too: three attempts per failed call triple the rate exactly when the limit is reached. Did our deploy overload a dependency?

An illustrative incident with two outcomes#

This example is illustrative. payments calls a card network API at api.example.com through an egress proxy at 10.0.2.15. From 10:05 UTC about 30% of calls fail, and the application logs provider unavailable for both 429 and 503.

In the first outcome, the stored headers on failed calls show 429, Retry-After: 30 and the provider's X-Request-Id. A curl with the production key returns the same; a curl with the staging key from the same proxy returns 200. The rate-limit header shows a remaining count of 0 until the window resets each minute. A release at 09:58 started calling the token endpoint once per payment instead of caching the token for its lifetime, which doubled the request rate. Your quota ran out and the provider is healthy.

In the second outcome, failed calls return 503 with a Server header naming the proxy software and no provider request ID. A curl from the proxy host's network without the proxy reaches the provider and gets 200. The proxy's upstream connection pool is full after its own configuration change at 10:03. The provider never saw those requests, and its status page correctly shows nothing. NAT and port exhaustion

Limits#

Quota headers describe the limit the provider chose to tell you about. GitHub, for example, documents secondary limits that cannot be checked in advance and can be hit for undisclosed reasons, and its remaining count can differ from one response to the next. GitHub REST rate limits

A test request from your laptop takes another network path and may use another key, so it shows only whether the provider answers on that path.

For AWS service APIs, the error codes and quota tools differ. AWS API throttling or quota

Questions#

What is the difference between HTTP 429 and 503 from an API?

429 means you have sent too many requests in some window that the server counts for you. 503 means the server cannot handle requests right now because of overload or maintenance. Both can include Retry-After. Providers do not apply them consistently, so read the headers and check whether other callers fail.

How do I tell if a 503 came from my proxy or the provider?

Look at Server, Via and any provider request ID in the response. A response generated by your proxy carries the proxy's server name and no provider ID. Repeating the call without the proxy, from the same network, shows whether the provider itself answers.

Should I retry a 429 immediately?

No. Wait for the time Retry-After gives, or for the reset time in the provider's headers. Immediate retries spend the quota faster and extend the failure.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading