OptionalenabledEnable rate limiting globally. Default: true
OptionalmaxMaximum calls allowed within the time window. Default: 100
OptionalmethodsHTTP methods to rate limit. Default: all methods
OptionalonCallback invoked when a request is rate limited. Called before waiting (if waitForToken is true) or rejecting.
OptionalrulesRoute-specific rules
OptionalserializerCustom serializer for generating rate limit bucket keys. Default groups requests by method + pathname.
OptionalshouldPre-check callback. Return false to bypass rate limiting for this request. Useful for whitelisting certain requests or implementing dynamic bypass logic.
OptionalwaitBehavior when rate limit is exceeded.
OptionalwindowTime window in milliseconds. Default: 60000 (1 minute)
Configuration for request rate limiting.
Rate limiting controls the rate of outgoing requests using a token bucket algorithm. Each unique request key (generated by the serializer) gets its own rate limit bucket, allowing per-endpoint or per-user rate limiting.