Help center / Connecting your AI

API errors and rate limits

Updated November 12, 2026 · 3 min read

The REST API answers every error with the same JSON shape: { "error": "...", "code": "..." }. The code is stable, so test it in your app. The message is written for a person and can change. When the body or the query string does not match the expected format, the answer also has a details field that lists the fields at fault.

POST /api/v1/search429
HTTP/1.1 429
Retry-After: 23
RateLimit-Limit: 60
RateLimit-Remaining: 0
RateLimit-Reset: 23

{
  "error": "Rate limit reached: 60 requests per
    minute per API key on this plan. Retry in 23 s.",
  "code": "RATE_LIMITED"
}
A request refused by the rate limit: the status, the headers and the body (example values).

Codes and what to do

  • 400 INVALID_JSON: the body is not JSON. Fix the request.
  • 400 INVALID_BODY, INVALID_QUERY: a field or a query parameter is missing or invalid. Read the message, and details when it is present.
  • 401 INVALID_API_KEY: the key is missing, unknown or revoked. Send it as Authorization: Bearer mp_…, or create a new key in Connections, tab API keys.
  • 402 MTU_QUOTA_REACHED: a new end user would exceed the limit of tracked users (your plan’s quota on Free, 150% of it on a paid plan), on an endpoint other than search and save: brains, documents, corrections, archive. Nothing was stored. Search and save do not return this code: they answer 200 without memory and add the header x-crystalbrain-quota: exceeded. See the tracked users quota.
  • 404 NOT_FOUND: no user, brain, memory or contradiction with this name or ID.
  • 409 INVALID_STATE: the action does not apply, for example a contradiction that is already closed, an archived memory, memories of different brains, or a memory that changed in the meantime. Read the item again before retrying.
  • 409 USER_ARCHIVED: the user is archived. Calls that name it, or that read one of its brains or memories by ID, are refused. Restore it on the End users page.
  • 409 NOT_A_USER: the name is a group of users. Name one of its members.
  • 409 USER_DELETION_PENDING: the user is scheduled for permanent deletion. Calls that name it, or that read one of its brains or memories by ID, are refused until it is deleted, unless you cancel the deletion with POST /api/v1/user/restore.
  • 429 RATE_LIMITED: too many requests for this key this minute. Wait for the number of seconds in the Retry-After header.
  • 503 EMBEDDING_UNAVAILABLE: the embedding service is busy. Retry in a moment.
  • 500 INTERNAL_ERROR: an unexpected error. Retry later.

Rate limits

Requests are counted per API key and per minute, and the limit depends on the workspace’s plan: 60 on Free, 300 on Starter, 600 on Pro. The count starts again at each new minute. Two keys of the same workspace each have their own count. Beyond the limit, the API answers 429 with Retry-After and the three RateLimit- headers shown above.

The limit does not apply to the MCP connection used by AI assistants. The TypeScript and Python SDKs raise a CrystalBrainError that holds the code, the status and the retry delay.

Every endpoint, field and code is listed in the API reference. To be told the first time a user goes over the quota in a month, add a webhook for the quota.reached event.

Free up to 25 tracked users, no card.

Start free