Back to all terms
ClientAPI
APIbasic

Rate Limit Headers

Standardized HTTP response headers that communicate rate limit quotas, remaining capacity, and reset times to API consumers.

Also known as: X-RateLimit Headers, RateLimit Header Fields

Description

Rate limit headers are HTTP response headers that inform API consumers about their current rate limit status on every response, not just when they've been throttled. The conventional headers are X-RateLimit-Limit (the maximum number of requests allowed in the current window), X-RateLimit-Remaining (how many requests the client has left), and X-RateLimit-Reset (when the rate limit window resets, typically as a Unix epoch timestamp). The IETF draft RFC 9110 proposes standardizing these as RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset (using delta seconds instead of epoch).

Including these headers on every successful response -- not just 429 responses -- enables clients to implement proactive throttling. A well-behaved client can monitor its remaining quota and slow down before hitting the limit, resulting in smoother traffic patterns for both the client and the server. SDKs and client libraries often use these headers to implement automatic retry-with-backoff logic.

When a client exceeds the rate limit, the 429 Too Many Requests response should include a Retry-After header indicating how long the client should wait before retrying. This can be expressed as a delta in seconds or as an HTTP-date. Consistent header naming and value formats across all endpoints reduce confusion and make it easier for consumers to build robust integration logic.

Prompt Snippet

Include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (Unix epoch seconds) on every API response via gateway middleware, not just on 429 responses. On throttled requests, return 429 with a Retry-After header set to the number of seconds until the window resets. Follow the IETF RateLimit Fields draft (draft-ietf-httpapi-ratelimit-headers) for forward compatibility. For APIs with multiple rate limit policies (e.g., per-minute and per-day), include a RateLimit-Policy header describing each policy's quota and window.

Tags

rate-limitinghttp-headersconventionsclient-experience