Skip to content
BotBaseDocs
PricingDashboardStart free
  • Build AI assistants that know your business
  • Quick start
  • Core concepts
  • Create an account
  • Documents
  • Websites
  • Social media posts
  • How answers are grounded
  • Languages
  • Assistant types and plans
  • Create an assistant
  • Personality and instructions
  • Testing your assistant
  • Conversations
  • Leads, forms and human support
  • Booking agent
  • Email replies
  • AI models
  • Website widget
  • Widget appearance and design
  • Chat link and QR code
  • Connect your business platform
  • CRM lead sync
  • Management Agents overview
  • Integration guide
  • Roles and permissions
  • Security model
  • Server and browser API reference
  • Examples by industry
  • Audit log and troubleshooting
  • Developer API overview
  • API keys
  • Chat API reference
  • Errors and limits
  • Plans and the free trial
  • Billing and payments
  • Emails and notifications
  • Security and privacy
  • Troubleshooting
  • Frequently asked questions
Docs/Developer API/Errors and limits

Errors and limits

Status codes and error bodies returned by the Developer API and the public widget API, rate limits, and monthly chat message allowances.

Developer API·5 min read·Updated 2 Dec 2026

#Developer API errors

The Developer API (/api/v1/agents and /api/v1/chat) returns errors as a flat JSON object with an error string. Some errors add extra fields.

JSON
{ "error": "Invalid or revoked API key." }
Statuserror messageWhen it happens
400message is required and must not be empty.message is missing, empty or only spaces.
400message exceeds 4000 character limit.message is longer than 4,000 characters after trimming.
400streaming is not supported yet — call with stream=false.You sent "stream": true.
401Invalid or revoked API key.The X-API-Key header is missing, wrong, revoked or expired.
402A message about the monthly allowanceThe account has used its monthly chat messages. See Monthly allowance errors.
403Agent AGENT_ID does not belong to this API key's workspace.The assistant exists but is in another workspace.
403This API key is not authorised to access agent AGENT_ID.The key is restricted to other assistants.
404Agent not found or is not active.Wrong agent_id, or the assistant is turned off.
404Conversation not found.The conversation_id does not exist or belongs to a different assistant.
429Rate limit exceeded.Too many requests with this key. Includes retry_after_seconds.
500An internal error occurred. Please try again.Something failed while answering.
503This assistant is temporarily unavailable.The service is paused by BotBaseX or the account is suspended.

Validation happens in this order: the message is checked first (400), then the key (401), then the rate limit (429), then the assistant (404, 403).

If agent_id is missing entirely, the request fails schema validation with a 422 in the standard FastAPI shape ({"detail": [...]}) rather than the flat error shape.

Repeated 500 errors on one assistant?

Check the assistant in the dashboard. An advanced assistant (for example AI Sales & Customer Support) whose plan or trial no longer covers it is paused and cannot answer through any channel until you upgrade.

#Monthly allowance errors

When the account's monthly chat messages are used up, /chat returns 402 with structured fields so you can stop retrying until the next month:

JSON
{
  "error": "You have used all 100 chat messages for this month. Upgrade to Standard or Pro for more.",
  "code": "chat_messages_limit_reached",
  "resource": "chat_messages",
  "used": 100,
  "limit": 100,
  "plan": "free"
}

Do not retry a 402 in a loop. It will keep failing until the allowance resets on the 1st of the next month (UTC) or the account is upgraded.

#Rate limit errors

JSON
{ "error": "Rate limit exceeded.", "retry_after_seconds": 12 }

Wait retry_after_seconds before sending again.

#Developer API rate limits

EndpointLimit
POST /api/v1/chat60 requests per 60 seconds per API key
GET /api/v1/agentsNo separate per-key limit
GET /api/v1/healthNo separate limit

Limits are counted per key in a rolling 60-second window. If you need more throughput, spread traffic over several keys only if they serve genuinely separate integrations; the monthly allowance is shared by the whole account anyway.

#Handling errors well

  • 400, 403, 404: fix the request; retrying the same call will not help.
  • 401: check the key in your environment; it may have been revoked or expired.
  • 402: stop and alert yourself; the account needs an upgrade or the new month.
  • 429: wait retry_after_seconds, then retry.
  • 500, 503: retry a few times with increasing delays (for example 2, 5 and 15 seconds).

#Public widget API

The website widget and hosted chat page use public endpoints under /public/, authenticated by an embed token instead of an API key. You normally never call these yourself, but these errors explain what your visitors may see. They use FastAPI's detail shape:

JSON
{ "detail": "Invalid embed token." }
StatusdetailWhen it happens
401Invalid embed token.The token does not exist.
403This embed token has been revoked.The website code was revoked.
403Agent is not available.The assistant is turned off.
403Origin ... is not authorised for this widget.The page's domain is not in the code's allowed origins.
403A null or unparseable Origin is not authorised for this widget.Allowed origins are set and the page sent no usable origin (for example a file:// page).
404Conversation not foundThe stored conversation no longer matches this assistant.
422Validation detailsEmpty message, or more than 4,000 characters.
429Rate limit exceeded. Please slow down.More than 20 requests in 60 seconds for one embed token.
429An object with code: chat_messages_limit_reachedThe account's monthly chat messages are used up.
500Chat is temporarily unavailable. Please try again.Something failed while answering.
503This assistant is temporarily unavailable.The service is paused, the account is suspended, or the assistant is an advanced type that the plan or trial no longer covers.

The widget turns these into short, neutral messages for visitors, so no plan or account details are shown to the public. See Website widget troubleshooting.

Production servers may also apply a per-IP limit to /public/ and sign-in routes. When it triggers, the response is 429 with {"detail": "Too many requests. Slow down and retry."} and a Retry-After header.

#Monthly chat message allowance

Every message a visitor or your code sends to an assistant counts as one chat message, whichever channel it comes from: website widget, hosted chat page, Developer API, or the test chat in your dashboard.

PlanChat messages per month
Free100
Standard5,000
ProUnlimited
14-day trialUnlimited
  • The allowance belongs to the account, shared across all its workspaces and assistants.
  • Months are calendar months in UTC: the count resets at 00:00 UTC on the 1st.
  • A message counts when it is received, before the AI answers, so failed attempts still count.
  • You can see usage under Plan in your workspace.

See Plans and the free trial for everything each plan includes.

PreviousChat API referenceNext Plans and the free trial

On this page

  • Developer API errors
  • Monthly allowance errors
  • Rate limit errors
  • Developer API rate limits
  • Handling errors well
  • Public widget API
  • Monthly chat message allowance