Open source · API & Integration

Rate Limit Header Inspector

Inspect rate-limit headers and model retry timing from captured responses.

v0.1.0 · Node.js 22+ · MIT

Browse the public repository · View releases

TOOLID=rate-limit-header-inspector. A zero-dependency Node 22+ offline reporter for captured HTTP response headers. It does not send requests, sleep, schedule jobs or retry traffic. It calculates a conservative local retry window from exported evidence and an explicit evaluation clock; this is not a promise that a server will accept a retry.

This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+; inspect the source before using it on your own files.

Run the checked-in example

node bin/rate-limit-header-inspector.mjs --root examples/passing --policy policy.json --capture capture.json
node bin/rate-limit-header-inspector.mjs --root examples/failing --policy policy.json --capture capture.json

Read the result

The first example exits 0 with 90 seconds remaining. The second exits 1 because that window exceeds a 60-second policy budget. @capture and @policy are logical source roles; /responses/N is a zero-based pointer into the exact captured file named at invocation. No response header value, path or request identifier is emitted.

Where this check stops

Capture 1,048,576 bytes; policy 65,536 bytes; JSON depth 16; 1,000 responses; 100 headers per response; 8,192 characters per header value; retry delta 604,800 seconds; evaluation 5,000 ms. Limits are inclusive; N+1 is incomplete for capture evidence or invalid configuration for policy. Input is strict UTF-8 and realpath-confined inside --root. The tool writes no files and uses no network. No live retries, status polling, automatic throttling, generic vendor-specific X-RateLimit- interpretation, or inference of future server behavior is included. The library exports TOOLID, LIMITS, RULES, validPolicy and inspectHeaders(capture,policy,{now,budgetNow,deadline}).

Before adapting the command to your own workflow, review the accepted inputs, exit codes and safety boundaries in the README.

Compiled with AI assistance from checked-in public documentation and example scripts. Run the example and review the repository's current documentation before relying on its result.