Errors & Rate Limits
The API uses conventional HTTP status codes. Successful requests return 2xx; client errors return 4xx; server-side failures return 5xx.
| Status | Meaning | When it happens |
|---|---|---|
| 400 | Bad Request | Missing or invalid field in the request body. |
| 401 | Unauthorized | Missing, invalid, or revoked API key. |
| 402 | Payment Required | Your wallet balance is insufficient for this call. See Billing → Insufficient balance (402). Never returned for auto-postpaid Enterprise keys. |
| 403 | Forbidden | The key's scopes don't include the endpoint you called. |
| 429 | Too Many Requests | You've exceeded your tier's requests-per-minute limit. |
| 500 | Internal Server Error | Something 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:
| Tier | Requests / minute |
|---|---|
| Free | 20/min |
| Tier 1 | 100/min |
| Tier 2 | 500/min |
| Enterprise | 2000/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.