Skip to content

Commit 1507956

Browse files
authored
Update API Rate Limit Headers to reflect IETF Proposal (#25269)
* Update API Rate Limit Fundamentals with IETF Format Headers * Update Changelog for API Rate Limits to include IETF Formatted Headers
1 parent f6d44d5 commit 1507956

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/content/changelog/fundamentals/2025-09-03-rate-limiting-improvement.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ As always, if you need any help with rate limits, please contact Support.
1515
#### New Headers
1616

1717
**Headers that are always returned:**
18-
- X-RateLimit-Limit: Total Number of requests the caller can make
19-
- X-RateLimit-Remaining: Number of requests before Rate Limit kicks in
18+
- `Ratelimit`: List of service limit items, composed of the limit name, the remaining quota (`r`) and the time next window resets (`t`). For example: `"default";r=50;t=30`
19+
- `Ratelimit-Policy`: List of quota policy items, composed of the policy name, the total quota (`q`) and the time window the quota applies to (`w`). For example: `"burst";q=100;w=60`
2020

2121
**Returned only when a rate limit has been reached (error code: 429):**
2222
- Retry-After: Number of Seconds until more capacity is available, rounded up
23-
- X-RateLimit-Reset: RFC 1123 Formatted Date as to when more capacity is available
2423

2524
#### SDK Back offs
26-
- All SDKs will automatically respond to the headers, instituting a backoff when limits are approached.
25+
- All of Cloudflare's latest SDKs will automatically respond to the headers, instituting a backoff when limits are approached.
2726

2827
### GraphQL and Edge APIs
2928
These new headers and back offs are only available for Cloudflare REST APIs, and will not affect GraphQL.

src/content/docs/fundamentals/api/reference/limits.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ import { Render } from "~/components";
1313

1414
The following headers are returned when calling REST APIs:
1515

16-
- `ratelimit-limit`: The total number of requests a caller can make.
17-
- `ratelimit-remaining`: The number of remaining requests before the rate limit takes effect.
18-
- `retry-after`: The number of seconds, rounded up, until more capacity is available.
19-
- `ratelimit-reset`: The `RFC 1123` formatted date when more capacity is available.
16+
- `Ratelimit`: List of service limit items, composed of the limit name, the remaining quota (`r`) and the time next window resets (`t`). For example: `"default";r=50;t=30`
17+
- `Ratelimit-Policy`: List of quota policy items, composed of the policy name, the total quota (`q`) and the time window the quota applies to (`w`). For example: `"burst";q=100;w=60`
18+
- `retry-after`: The number of seconds, rounded up, until more capacity is available. Note, this header is only returned when the request has exceeded the rate limit.
2019

2120
Cloudflare's SDKs will also automatically work with the headers and back off in response to rate limits.

0 commit comments

Comments
 (0)