ratelimit-headers
Skill1 starsChanged 59 days agoMITView on GitHub
RateLimit headers: advertise HTTP API quotas, handle 429 with the IETF RateLimit and RateLimit-Policy header fields (draft-11 of draft-ietf-httpapi-ratelimit-headers), Retry-After (RFC 9110) and 429 Too Many Requests (RFC 6585). Use when adding rate limiting or quota headers to an API, returning or handling a 429, writing a client that backs off or paces itself, upgrading from X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset or from older drafts (RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, or a limit/remaining/reset RateLimit dictionary), or choosing the quota-exceeded problem type for a throttled response. Triggers: rate limit headers, RateLimit-Policy, quota policy, throttling, backoff, Retry-After, Too Many Requests, partition key, Structured Fields (RFC 9651).
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- find-skillsSkill
- a2aSkill
- ag-uiSkill
- ap2Skill
- asyncapiSkill
- authzenSkill
- cedarSkill
- cloudeventsSkill
- eu-ai-actSkill
- fapiSkill
- gnapSkill
- jwtSkill
- mcp-authorizationSkill
- oauthSkill
- ocsfSkill
- openapi-arazzoSkill
- openapi-overlaySkill
- openapiSkill
- openfeatureSkill
- openid4vcSkill
- openid-connectSkill
- openid-federationSkill
- openidSkill
- opentelemetry-genaiSkill
- owasp-agenticSkill
- problem-detailsSkill
- scaledock-agent-permissionsSkill
- scaledock-enterprise-identitySkill
- scaledock-http-apiSkill
- scaledock-mcp-serverSkill
- scaledock-repo-standardSkill
- scimSkill
- shared-signalsSkill
- spiffeSkill
- standard-schemaSkill
- typespecSkill
- web-bot-authSkill
- webmcpSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Retry-Afterwins: When both are present, the client MUST give Retry-After precedence (§ 7), and the server SHOULD NOT make Retry-After … - Very specific: line 41
Pick the version: Use draft-11. If the server or client already uses X-RateLimit-*, RateLimit-Limit or a limit= dictionary, identify its …
- Distinctive: line 56
Check intermediaries, caching and security: Make sure gateways only tighten the advertised policy, and review the security and privacy …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
RateLimit header fields for HTTP
The IETF HTTPAPI working group's draft defines two response header fields: RateLimit-Policy advertises a server's quota policies, and RateLimit reports the quota currently available under one of them. With this skill the agent emits and reads both, pairs them with Retry-After (RFC 9110) and 429 Too Many Requests (RFC 6585), and writes the throttled response body.
Draft posture: build (draft-ietf-httpapi-ratelimit-headers-11, 23 May 2026). Implement the pinned revision's current shape. Retry-After and the 429 status are the stable fields that carry the essential "wait" signal to clients that ignore the draft.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. Bare section numbers (§ 4.1) refer to the pinned draft. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: server (emits the fields), client (reads them), or intermediary (gateway or proxy that passes or rewrites them).
- Quota policies: for each one, a name, the quota, the window in seconds, the unit (requests, content bytes or concurrent requests) and how clients are partitioned.
- Target version: draft-11 (default, posture build: implement and emit it). draft-07, draft-06 and earlier, and X-RateLimit headers are legacy: read them and upgrade from them, never emit them in new work. No preview exists. See
references/versions.md. - Revision: the pinned draft revision in Sources, unless the user names another.
- Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources first, check the datatracker page for a newer revision or an RFC number, and update the pins. The pinned revision expires on 24 November 2026.
Invariants
RateLimit-Policyis a non-empty Structured Fields List of quota policy Items whose value MUST be a String naming the policy (§ 3). Each Item has a REQUIREDq(non-negative Integer quota) and optionalqu(String unit, default requests),w(positive Integer window in seconds) andpk(Byte Sequence partition key) (§ 3.1, § 3.1.1 to § 3.1.4).RateLimitis a Structured Fields List of service limit Items, each identifying a policy (§ 4, § 4.1). Each has a REQUIREDr(non-negative Integer available quota) and optionalt(non-negative Integer effective window in seconds) andpk(§ 4.1.1 to § 4.1.3).- Never in trailers. Neither field may appear in a trailer section (§ 3.1, § 4.1).
Retry-Afterwins. When both are present, the client MUST giveRetry-Afterprecedence (§ 7), and the server SHOULD NOT makeRetry-Afterpoint earlier than the end of the effective window (§ 6).- Hints, not guarantees. Clients MUST NOT treat a positive
ras a guarantee (§ 4.1.1, § 8.3), MUST NOT assume the quota is fully restored aftert(§ 4.1.2), and MUST NOT assume later responses carry the fields at all (§ 7). - Malformed fields are ignored. Clients MUST ignore malformed RateLimit fields (§ 7); a Structured Fields parse failure means the whole field is ignored (RFC 9651 § 4.2).
- No capacity leaks. A server MUST NOT convey values that expose an unwanted volume of requests, and SHOULD cap the ratio between
randt(§ 6, § 8.5). - Policy names are printable ASCII. Structured Fields Strings allow only
%x20to%x7E, with"and\escaped; anything else fails serialization (RFC 9651 § 3.3.3, § 4.1.6). - A 429 is not cached. Responses with 429 MUST NOT be stored by a cache, and SHOULD include details explaining the condition (RFC 6585 § 4).
Workflow
- Pick the version. Use draft-11. If the server or client already uses
X-RateLimit-*,RateLimit-Limitor alimit=dictionary, identify its line and plan the upgrade (step 7). ->references/versions.md✓ Every field the work emits is a draft-11RateLimit-PolicyorRateLimitfield, orRetry-After. - Model the quota policies. Name each policy and set
q,w,quandpk. Prefix any service-specific parameter with a vendor identifier (§ 3.1, § 4.1). Decide how partition keys are derived and document it (§ 6.1). ->references/fields.md✓ Every policy has an ASCII name, an Integerq, and a window in whole seconds; partition keys contain no sensitive data. - Emit the fields. Send
RateLimit-Policywhere policies are stable andRateLimitwith the currentrandt(§ 3, § 4). Sending them on every response is optional (§ 6.2), and they are independent of the status code (§ 6). ->references/fields.md,references/examples.md✓ Serialized values parse as Structured Fields Lists, andrandtnever reveal more capacity than intended. - Answer throttled requests. Return 429 (or 503 for reduced capacity) with
Retry-After, the RateLimit fields, and a problem details body using the draft's problem types (§ 5). ->references/examples.md✓Retry-Afteris not earlier than the end of the effective window, and the body explains the condition (RFC 6585 § 4). - Implement the client. Parse both fields, ignore malformed ones, honor
Retry-Afterfirst, and pace requests so the available quota is not exceeded within the effective window (§ 7). ->references/behavior.md✓ The client survives missing, malformed and implausible values, and ignores fields on cached responses (§ 7.3, § 8.5.1). - Check intermediaries, caching and security. Make sure gateways only tighten the advertised policy, and review the security and privacy considerations.
->
references/behavior.md✓ No intermediary makes the policy more permissive or strips the fields (§ 7.2), and reset times carry jitter (§ 8.5). - Upgrade (only when asked). Follow the checklist for the source line: name each policy, move the limit into
q, the remaining count intorand the reset intotas delay-seconds. ->references/versions.md✓ The new fields parse as RFC 9651 Lists, and clients back off at the same points as before.
Verify before done
- Every
RateLimit-PolicyandRateLimitvalue parses with an RFC 9651 List parser, and every Item value is a String. - Every policy Item has
q; every service limit Item hasr; all numbers are non-negative Integers, andwis greater than zero (§ 3.1.1, § 3.1.3, § 4.1.1, § 4.1.2). - Each
RateLimitItem names a policy the server defines, andpkvalues, if any, are Byte Sequences (§ 3.1.4, § 4.1.3). - Throttled responses carry
Retry-Afterin the RFC 9110 § 10.2.3 format, no earlier than the effective window ends (§ 6). - The client gives
Retry-Afterprecedence, ignores malformed fields, and does not rely on the fields being present (§ 7). - The output matches the shapes in the draft's examples (§ 3.2, § 4.2, Appendix B), without copying their known typos (see
references/examples.md).
Reference index
references/versions.md: draft-11 and the legacy lines with their status, what changed between the header designs, and upgrade checklists from each. Load for steps 1 and 7.references/fields.md: syntax of both fields, every parameter, Structured Fields serialization rules, and how they map onto the legacyX-RateLimit-*headers. Load for steps 2 and 3.references/behavior.md: server, client and intermediary rules, caching, and the security and privacy considerations. Load for steps 5 and 6.references/examples.md: full HTTP exchanges, the draft's problem types, and framework-neutral TypeScript for serializing and parsing. Load for steps 3 and 4.
Related skills
problem-detailsfor the RFC 9457 body of a 429 or 503 response:npx skills add ScaleDockHQ/scaledock-skills --skill problem-details.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
Draft posture: build, pinned to draft-ietf-httpapi-ratelimit-headers-11.
- RateLimit header fields for HTTP (draft-ietf-httpapi-ratelimit-headers-11): WG draft (IETF HTTPAPI), revision 11 of 23 May 2026, checked 2026-10-05.
- Datatracker: draft-ietf-httpapi-ratelimit-headers: WG draft (IETF HTTPAPI), active, no RFC; revision 11 latest, history back to draft-polli-ratelimit-headers-00, checked 2026-10-05.
- draft-ietf-httpapi-ratelimit-headers-08: WG draft (IETF HTTPAPI), superseded, revision 08 of 7 October 2024, checked 2026-10-05.
- draft-ietf-httpapi-ratelimit-headers-07: WG draft (IETF HTTPAPI), superseded, revision 07 of 24 June 2023, checked 2026-10-05.
- draft-ietf-httpapi-ratelimit-headers-06: WG draft (IETF HTTPAPI), superseded, revision 06 of 22 December 2022, checked 2026-10-05.
- draft-ietf-httpapi-ratelimit-headers-00: WG draft (IETF HTTPAPI), superseded, revision 00 of 18 December 2020, checked 2026-10-05.
- draft-polli-ratelimit-headers-00: Individual draft, replaced by draft-ietf-httpapi-ratelimit-headers, revision 00 of 5 September 2019, checked 2026-10-05.
- RFC 9110: HTTP Semantics: RFC (Internet Standard, STD 97), RFC 9110, checked 2026-10-02.
- RFC 6585: Additional HTTP Status Codes: RFC (Proposed Standard), RFC 6585, checked 2026-10-02.
- RFC 9651: Structured Field Values for HTTP: RFC (Proposed Standard), RFC 9651, checked 2026-10-02.
- RFC 9457: Problem Details for HTTP APIs: RFC (Proposed Standard), RFC 9457, checked 2026-10-02.
- IANA HTTP Problem Types registry: IANA registry, last updated 2026-06-26, checked 2026-10-02.
- IANA HTTP Field Name registry: IANA registry, read 2026-10-02 (no RateLimit entries yet), checked 2026-10-02.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

