RateLimitError
HTTP 429 — the provider rate-limited the request. Retryable with backoff.
Example
Section titled “Example”if (err instanceof RateLimitError) { await sleep(err.retryAfter ?? 5000)}Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RateLimitError(
provider,retryAfter?,cause?):RateLimitError
Parameters
Section titled “Parameters”provider
Section titled “provider”string
retryAfter?
Section titled “retryAfter?”number
cause?
Section titled “cause?”Error
Returns
Section titled “Returns”RateLimitError
Overrides
Section titled “Overrides”Properties
Section titled “Properties”cause?
Section titled “cause?”
readonlyoptionalcause?:Error
Original error that caused this one, if any.
Inherited from
Section titled “Inherited from”code:
string
Machine-readable error code (e.g., “ABORT”, “RATE_LIMIT”, “TOOL_DENIED”).
Inherited from
Section titled “Inherited from”provider
Section titled “provider”
readonlyprovider:string
Provider name (e.g., “anthropic”, “openai”).
Inherited from
Section titled “Inherited from”retryable
Section titled “retryable”
readonlyretryable:boolean
Whether this error can be retried by retry middleware.
Inherited from
Section titled “Inherited from”retryAfter?
Section titled “retryAfter?”
readonlyoptionalretryAfter?:number
Suggested wait time in seconds before retrying, if the provider sent one.
statusCode?
Section titled “statusCode?”
readonlyoptionalstatusCode?:number
HTTP status code from the provider API, if available.