Errors & Rate Limits

The API uses conventional HTTP status codes. Successful requests return 2xx; client errors return 4xx; server-side failures return 5xx.

StatusMeaningWhen it happens
400Bad RequestMissing or invalid field in the request body.
401UnauthorizedMissing, invalid, or revoked API key.
402Payment RequiredYour wallet balance is insufficient for this call. See Billing → Insufficient balance (402). Never returned for auto-postpaid Enterprise keys.
403ForbiddenThe key's scopes don't include the endpoint you called.
429Too Many RequestsYou've exceeded your tier's requests-per-minute limit.
500Internal Server ErrorSomething went wrong on our side. These are logged and generally transient.

Error response shape

Every /v1 error returns this envelope (matches the OpenAI/Anthropic SDK convention). SDKs raise a single exception type (CAILegalAPIError) with .errorType/.errorCode parsed out of it.

Error response

{
  "error": {
    "type": "invalid_request_error",
    "message": "'message' is required.",
    "code": "missing_field"
  }
}

Pre-launch responses used a plain FastAPI { detail: ... } body ({"detail":"'message' is required."}) — no longer returned, kept here only for historical reference if you integrated before the standardized envelope shipped.

Rate limits

Rate limits are enforced per API key, using a sliding 60-second window, and scale with your key's tier:

TierRequests / minute
Free20/min
Tier 1100/min
Tier 2500/min
Enterprise2000/min

When you exceed your limit, the API returns 429 with a message naming your tier and its limit. Back off and retry — see Idempotency & Retries. Need a higher limit? Upgrade your tier from the Developer Console.