Mintplex-Labs/anything-llm · warning

The quota for this chat has been reached. Try again later or

Error message

The quota for this chat has been reached. Try again later or contact the site owner.

What it means

The user-facing half of the same 429 daily-quota response: alongside machine-readable error 'Rate limit exceeded', the payload carries errorMsg 'The quota for this chat has been reached. Try again later or contact the site owner.' — written to be shown to end visitors of an embedded chat. The response also has type:'abort' and close:true so the widget knows the stream is over.

Source

Thrown at server/utils/middleware/embedMiddleware.js:137

          ? "Message is empty."
          : `${embed.chat_mode} is not a valid mode.`,
      });
      return;
    }

    if (
      !isNaN(embed.max_chats_per_day) &&
      Number(embed.max_chats_per_day) > 0
    ) {
      const dailyChatCount = await EmbedChats.count({
        embed_id: embed.id,
        createdAt: {
          gte: new Date(new Date() - 24 * 60 * 60 * 1000),
        },
      });

      if (dailyChatCount >= Number(embed.max_chats_per_day)) {
        response.status(429).json({
          id: uuidv4(),
          type: "abort",
          textResponse: null,
          sources: [],
          close: true,
          error: "Rate limit exceeded",
          errorMsg:
            "The quota for this chat has been reached. Try again later or contact the site owner.",
        });
        return;
      }
    }

    if (
      !isNaN(embed.max_chats_per_session) &&
      Number(embed.max_chats_per_session) > 0
    ) {
      const dailySessionCount = await EmbedChats.count({

View on GitHub (pinned to 3aec848f28)

Solutions

  1. In widget code, prefer errorMsg when present and fall back to error
  2. Treat type:'abort' with close:true as terminal — do not auto-retry
  3. Site owner: raise or clear max_chats_per_day on the embed to stop the 429s

Example fix

// before
showToast(data.error); // 'Rate limit exceeded' — jargon shown to visitors

// after
if (data.errorMsg) showToast(data.errorMsg); // visitor-friendly quota message
else if (data.error) console.warn(data.error);
Defensive patterns

Strategy: fallback

Type guard

const hasVisitorMessage = (payload) =>
  typeof payload?.errorMsg === 'string' && payload.errorMsg.length > 0;

Try / catch

const data = await res.json();
show(data.errorMsg ?? data.error ?? 'Chat unavailable'); // prefer the visitor-facing errorMsg

Prevention

When it happens

Trigger: Same condition as the daily quota abort (EmbedChats count in 24h >= max_chats_per_day); this string is what well-behaved widgets are expected to render to the visitor.

Common situations: Widget integrations that display the raw error field instead of errorMsg, leaking 'Rate limit exceeded' jargon to visitors; support tickets where site owners did not realize a quota was configured.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/66b0c224d8bbf682. Report an issue: GitHub.