Use response headers to handle retry in case a 429 error is returned for each API call.
// The server's quota for requests by the client in the time window.
.header('X-RateLimit-Limit', `${getPoints(type)}`)
// The remaining quota in the current window.
.header('X-RateLimit-Remaining', `${rateLimiterRes.remainingPoints}`)
// The time remaining in the current window specified in seconds.
.header('X-RateLimit-Reset', `${rateLimiterRes.msBeforeNext / MILLIS_PER_SECOND}`)
// Indicates the quota policies currently associated with the client.
.header(
'X-RateLimit-Policy',
`${getPoints(type)};w=${getOpenapiApiEnv('rateLimitDuration')};comment="fixed window"`
Use response headers to handle retry in case a 429 error is returned for each API call.