Automatic Retries
The SDK automatically retries on transient errors (429, 500, 503, 504, and network errors) with exponential backoff. Retry behavior:GETandDELETErequests are always retried- Enrichment calls generate an idempotency key and reuse it across automatic retries. Supply your own
idempotencyKeyto safely retry across separate calls - A
409for the same enrichment that is still in progress is retried afterRetry-Afterand returns the stored result. A409withreason: "payload_mismatch"is not retried - The
Retry-Afterheader is respected when present - With pacing, after a
429other calls on the same client wait too (see Pacing), and a retry is only sent with at leastmin(1s, timeout / 2)ofmaxRetryTimeleft - Defaults: 3 retries, 500ms base delay, 30s max delay
Pacing
Pacing keeps a client’s requests within your organization’s rate limits, so a burst of calls, such asPromise.all over a batch, waits its turn on the client instead of being refused with 429. It is on by default in Node.js and Bun, and off by default elsewhere (see Cloudflare Workers and other runtimes).
- Concurrency. Enrichments in flight stay within
X-RateLimit-Concurrency-Limit. Only enrichments wait for one of these slots, so reads are not held behind a queued batch. - Rate. All requests are spaced to the per-second rate in
X-RateLimit-Limiton responses whoseX-RateLimit-Scopeisrpsor absent. WhenX-RateLimit-Remainingshows fewer requests left than the client expects, for example while another process uses the same organization, the client slows down to match. - Before the limits are known. Until a response reports them, at most 5 requests are in flight, enrichments included. A proxy that strips the
X-RateLimit-*headers keeps a client at this limit; setpacing: falseor explicit limits in that case. - After a
429. Every call on the client waits for the limit it names:X-RateLimit-Scope: rps, or no scope, pauses all requests;concurrencypauses enrichments, and enrichments that hold a slot but have not been sent give it back. The pause lasts theRetry-Aftertime plus up to 20% (at most 1 second) of jitter. WithoutRetry-After, it lasts untilX-RateLimit-Reset, measured against the response’sDateheader, when that is at most 10 seconds away; otherwise the normal backoff applies. Other calls wait at most 60 seconds before trying again. - Fewer enrichments after a
concurrency429. The client keeps fewer enrichments in flight than were running when it was refused, then adds one back after as many successful enrichments as its current limit, counting only enrichments sent after the decrease. Refusals of enrichments sent before the limit was known do not lower it. - Retries first. A call that is retried keeps its place, and its enrichment slot while the limit allows, and goes ahead of calls that have not been sent yet.
- Budgets. Waiting for a turn before the first attempt is limited by
pacing.maxWait(default:maxRetryTime), not bytimeoutormaxRetryTime. A call that waits longer rejects withPacingTimeoutErrorand is never sent or charged.maxRetryTimestarts when the first attempt is sent. Pass asignalto cancel a call at any point.
Cloudflare Workers and other runtimes
Pacing is off by default in Cloudflare Workers, Deno, edge runtimes and browsers. Workers bind the work of each request to that request, so one request cannot reliably wait for another’s call to finish. In Workers, create the client inside each request handler, or keep pacing off. Within one request,pacing: true still paces a batch of calls on that request’s client. If you opt in with a client shared across requests, a slot granted to a request that no longer runs returns to the pool within a second; pass { signal: request.signal } to each call, so a call whose client has gone is not sent.
Tests with fake timers
Pacing usesDate.now() and setTimeout. In tests that fake timers, fake both and advance the clock, or set pacing: false.
Rate Limiting
Rate limit information is available on responses from rate-limited endpoints. The SDK paces requests and handles 429 responses automatically, but you can monitor usage:Health & API Info
Raw Requests
For endpoints not yet covered by a resource class, or when you need the full HTTP response (headers, rate limit info):rawPost and rawDelete for other HTTP methods.