diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 503d5b1f..01e0b8c7 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -788,6 +788,10 @@ class ApiUserRateLimiter: self.slug = slug def __call__(self, request: Request): + # Rate limiting disabled if billing is disabled + if state.billing_enabled is False: + return + # Rate limiting is disabled if user unauthenticated. # Other systems handle authentication if not request.user.is_authenticated: