{"record":{"id":"e7b1ff71227567bf","repo":"khoj-ai/khoj","slug":"i-m-glad-you-re-enjoying-interacting-with-me-you-e7b1ff","errorCode":null,"errorMessage":"I'm glad you're enjoying interacting with me! You've unfortunately exceeded your usage limit for today. You can subscribe to increase your usage limit via [your settings](https://app.khoj.dev/settings) or we can continue our conversation tomorrow?","messagePattern":"I'm glad you're enjoying interacting with me! You've unfortunately exceeded your usage limit for today\\. You can subscribe to increase your usage limit via \\[your settings\\]\\(https://app\\.khoj\\.dev/settings\\) or we can continue our conversation tomorrow\\?","errorType":"http","errorClass":"HTTPException","httpStatus":429,"severity":"warning","filePath":"src/khoj/routers/helpers.py","lineNumber":2149,"sourceCode":"            )\n            raise HTTPException(\n                status_code=429,\n                detail=\"I'm glad you're enjoying interacting with me! You've unfortunately exceeded your usage limit for today. But let's chat more tomorrow?\",\n            )\n        if not subscribed and count_requests >= self.requests:\n            if self.requests >= self.subscribed_requests:\n                logger.info(\n                    f\"Rate limit ({self.slug}): {count_requests}/{self.subscribed_requests} requests not allowed in {self.window} seconds for user: {user}.\"\n                )\n                raise HTTPException(\n                    status_code=429,\n                    detail=\"I'm glad you're enjoying interacting with me! You've unfortunately exceeded your usage limit for today. But let's chat more tomorrow?\",\n                )\n\n            logger.info(\n                f\"Rate limit ({self.slug}): {count_requests}/{self.requests} requests not allowed in {self.window} seconds for user: {user}.\"\n            )\n            raise HTTPException(\n                status_code=429,\n                detail=\"I'm glad you're enjoying interacting with me! You've unfortunately exceeded your usage limit for today. You can subscribe to increase your usage limit via [your settings](https://app.khoj.dev/settings) or we can continue our conversation tomorrow?\",\n            )\n\n        # Add the current request to the cache\n        UserRequests.objects.create(user=user, slug=self.slug)\n\n    async def check_websocket(self, websocket: WebSocket):\n        \"\"\"WebSocket-specific rate limiting method\"\"\"\n        # Rate limiting disabled if billing is disabled\n        if state.billing_enabled is False:\n            return\n\n        # Rate limiting is disabled if user unauthenticated.\n        if not websocket.scope.get(\"user\") or not websocket.scope[\"user\"].is_authenticated:\n            return\n\n        user: KhojUser = websocket.scope[\"user\"].object","sourceCodeStart":2131,"sourceCodeEnd":2167,"githubUrl":"https://github.com/khoj-ai/khoj/blob/ae229ca894c0b80ad84664afcfdde523b5e87057/src/khoj/routers/helpers.py#L2131-L2167","documentation":"A 429 HTTPException raised when an unsubscribed user exceeds the request quota AND an upgrade path exists (free limit is below the subscribed limit). Unlike the sibling error, the message points the user to subscription settings because paying would actually raise the cap.","triggerScenarios":"Sending more than `self.requests` chat requests within `self.window` seconds as an unsubscribed user, when the limiter's free quota is strictly lower than `subscribed_requests` (e.g. 5 free vs 100 subscribed).","commonSituations":"Running an automation/integration script against app.khoj.dev on a free account; multiple team members sharing one free account; evaluating the hosted product and hitting the trial quota mid-test.","solutions":["Subscribe via https://app.khoj.dev/settings to raise the limit","Wait until the window resets to continue on the free tier","Throttle your client to stay under the free quota (add client-side limiting/backoff)","If self-hosted and unintentional, review the limiter configuration for the endpoint"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = await client.post('/api/chat', json=body)\nexcept HTTPStatusError as e:\n    if e.response.status_code == 429:\n        prompt_upgrade_or_wait()  # free tier below subscribed cap\n    else:\n        raise","preventionTips":["Subscribe if sustained usage is needed","Add client-side request budgeting per window","Back off exponentially on 429 instead of retrying immediately"],"tags":["rate-limit","http-429","khoj","subscription","usage-limit"],"backgroundTag":"http-429-rate-limit-exceeded","analyzedSha":"ae229ca894c0b80ad84664afcfdde523b5e87057","analyzedAt":"2026-08-27T03:32:41.843Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}