Reading API rate-limit headers: interpret quotas and retry timing
Rate-limit response headers can tell a client about the quota a server currently applies or how long to wait before another request. APIs do not all use the same field names or units. Check the API’s documentation first, honor Retry-After when present, and do not retry immediately based only on a counter or reset value.
Rate-limit response headers can tell a client about the quota a server currently applies or how long to wait before another request. APIs do not all use the same field names or units. Check the API’s documentation first, honor Retry-After when present, and do not retry immediately based only on a counter or reset value.
Common fields and standardization status
Many APIs have long used names such as X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. These X- conventions are widespread, but the name alone does not tell you whether a reset value is a delay in seconds, a Unix time in seconds or milliseconds, or an HTTP date. Interpret fields according to the provider’s documentation.
As checked on 2026-11-19, the HTTPAPI Working Group draft for RateLimit and RateLimit-Policy is draft-ietf-httpapi-ratelimit-headers-11. It is an Internet-Draft, not an RFC, and that revision is set to expire on 2026-11-24. Do not describe an implementation as a final standard; check both the adopted draft revision and the service documentation. In this revision, the policy field describes a policy identifier and quota, with optional units; RateLimit reports available quota when the response is generated.
RateLimit-Policy: "default";q=100;w=60
RateLimit: "default";r=13;t=42In this draft-format example, q=100 is the policy quota and w=60 is a 60-second window. r=13 is the available quota under that policy when the response was created, and t=42 is the effective window in seconds. These values are illustrative, not a real server response or a guaranteed limit. If no quota unit is supplied, the default is requests. Multiple policies with different units can apply at once, so do not treat one number as the API’s total remaining allowance.
Principles for reading a response
**Read status and fields together, but do not assume they correspond exactly.** The draft allows RateLimit fields on successful or error responses and does not require a fixed relationship between their values and the status. Even `r=0` does not prevent the server from serving the current request, nor guarantee that the next one will succeed.
**Honor `Retry-After` first.** Under HTTP semantics, its value can be a delay in seconds after the response or an HTTP date. A 429 means too many requests were sent within a period; a response may use `Retry-After` to say how long to wait. The May 2026 RateLimit draft says that when both `Retry-After` and `RateLimit` are present, the client must give precedence to `Retry-After`.
**Distinguish provider-specific limit categories.** A service can apply separate limits for search, concurrent requests, or resource groups in addition to a primary request quota. Tracking one counter may leave other limits unhandled.
**Handle absent or changing fields.** Servers need not include limit fields on every response, and cached values may be stale. The draft recommends ignoring RateLimit information on cached responses. Do not guess undocumented fields or treat an earlier value as permanent state.
Client retry procedure
Check the provider documentation for status codes, limit categories, field names, time units, whether quotas are shared by identity or IP, and behavior when fields are absent.
Parse available quota and wait timing using that provider’s rules. Do not assume a universal field name or `Reset` unit.
If `Retry-After` is present, do not retry until its indicated time has elapsed. If absent, consult the provider’s reset value and error body; otherwise slow the request rate and use exponential backoff.
Bound both the number of retries and total elapsed time. If failures continue, stop and return an explicit failure to the caller. Continuing requests while limited can lead to a block or a longer restriction.
Treat fields on successful responses as hints and leave a safety margin. Load, shared quota, or intermediaries can change the values in later responses.
GitHub REST API is one provider-specific example. Its documentation lists x-ratelimit-limit, x-ratelimit-remaining, and x-ratelimit-reset (UTC Unix epoch seconds), among others. When a primary limit is exceeded, it may return 403 or 429 with remaining equal to zero. A secondary limit can also return 403 or 429; if retry-after is present, GitHub says not to retry until those seconds have elapsed. Do not generalize these meanings or its 403 behavior to other APIs.
Checklist
Have you checked whether the API uses the draft fields or provider-specific fields?
Have you confirmed reset format, units, timezone, and which quota category the field describes?
Does the client prioritize `Retry-After`, use exponential backoff, and cap retries and total time?
Does it handle missing or cached fields and values that change in the next response?
Does it account for shared quotas by user or job and for separate limit groups?
Rate-limit headers are current server guidance for planning later requests, not a guarantee that a future request will succeed or a uniform contract across providers. Check the API’s documentation and actual field format, then follow the stated wait time and a bounded retry policy.
References
[IETF HTTPAPI: RateLimit header fields draft -11](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/11/)
[RFC 6585: Additional HTTP Status Codes, 429 Too Many Requests](https://www.rfc-editor.org/rfc/rfc6585.html)
[RFC 9110: HTTP Semantics, Retry-After](https://www.rfc-editor.org/rfc/rfc9110.html)
[GitHub REST API: Rate limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api)