Key rotation
Pluggable selection across a pool, with four built-in strategies and a typed
SelectorStrategy interface for custom logic.
Spread the same workload across N keys and lift the effective rate-limit ceiling by
roughly the size of the pool.
Automatic failover
Transient errors (408, 425, 429, 500, 502, 503, 504, plus Anthropic 529 and network resets) trigger an
instant rotation to the next eligible key.
User-facing failures from a single upstream outage drop to zero as long as one key in the
pool is healthy.
Per-key circuit breaker
Three-state machine (closed, open, half-open) with configurable threshold and
cooldown; opens after consecutive failures, recovers on first half-open success.
A failing key stops eating retry budget after a handful of attempts and rejoins the pool
on its own once it recovers.
Smart retry
AWS full-jitter exponential backoff with a total time budget, honouring upstream Retry-After
in both numeric-seconds and HTTP-date form.
Predictable tail latency under load instead of synchronised retry storms hammering the
same upstream window.
Health scoring
Each key carries a 0-to-100 health score that decays on failure with a configurable half-life and
recovers on success.
The pool quietly favours keys that are actually working, without you maintaining a
curated whitelist.
Telemetry
Eight in-process events (request.start/success/fail, key.rotated,
circuit.open/closed/half-open, all.exhausted), zero OpenTelemetry dependency.
Drop events into the logger or metrics pipeline you already run; no new agent, no new
vendor.
Auth-failure cooldown
A key that returns 401 Unauthorized is cooled for 24 hours on the assumption that the
credential itself is invalid.
A revoked or rotated key never burns retry budget; you fix it on your schedule, not the
request loop's.
Pluggable state
Memory backend by default; opt-in file backend persists only the hashed id and operational counters. Raw
key value never reaches disk.
Counter durability across restarts without trading away credential hygiene.
SLSA provenance
Every published version signed with npm publish --provenance through GitHub Actions OIDC.
Lockfile committed; supply-chain policy enforces minimum release age on new dependency versions.
Verify in one command that the tarball you installed was built from the source commit you
trust.