khoj-ai/khoj · warning · HTTPException

I'm glad you're enjoying interacting with me! You've unfortu

Error message

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?

What it means

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.

Source

Thrown at src/khoj/routers/helpers.py:2149

            )
            raise HTTPException(
                status_code=429,
                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?",
            )
        if not subscribed and count_requests >= self.requests:
            if self.requests >= self.subscribed_requests:
                logger.info(
                    f"Rate limit ({self.slug}): {count_requests}/{self.subscribed_requests} requests not allowed in {self.window} seconds for user: {user}."
                )
                raise HTTPException(
                    status_code=429,
                    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?",
                )

            logger.info(
                f"Rate limit ({self.slug}): {count_requests}/{self.requests} requests not allowed in {self.window} seconds for user: {user}."
            )
            raise HTTPException(
                status_code=429,
                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?",
            )

        # Add the current request to the cache
        UserRequests.objects.create(user=user, slug=self.slug)

    async def check_websocket(self, websocket: WebSocket):
        """WebSocket-specific rate limiting method"""
        # Rate limiting disabled if billing is disabled
        if state.billing_enabled is False:
            return

        # Rate limiting is disabled if user unauthenticated.
        if not websocket.scope.get("user") or not websocket.scope["user"].is_authenticated:
            return

        user: KhojUser = websocket.scope["user"].object

View on GitHub (pinned to ae229ca894)

Solutions

  1. Subscribe via https://app.khoj.dev/settings to raise the limit
  2. Wait until the window resets to continue on the free tier
  3. Throttle your client to stay under the free quota (add client-side limiting/backoff)
  4. If self-hosted and unintentional, review the limiter configuration for the endpoint
Defensive patterns

Strategy: retry

Try / catch

try:
    resp = await client.post('/api/chat', json=body)
except HTTPStatusError as e:
    if e.response.status_code == 429:
        prompt_upgrade_or_wait()  # free tier below subscribed cap
    else:
        raise

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of khoj-ai/khoj@ae229ca894 (2026-08-27). Data as JSON: /api/errors/e7b1ff71227567bf. Report an issue: GitHub.