API Reference
Errors
Stable machine-readable HTTP status codes and retry behavior.
Error envelope
{ "error": { "code": "invalid_api_key", "message": "This API key is not valid or has been revoked." } }Error codes
| Status | Code | Retry? | Action |
|---|---|---|---|
| 400 | invalid_json | No | Send valid UTF-8 JSON. |
| 401 | missing_api_key | No | Add Authorization: Bearer mk_... header. |
| 401 | invalid_api_key | No | Verify key format (48 chars) or mint a new key. |
| 402 | insufficient_credit | No | Top up credit under Billing. |
| 402 | spend_cap_reached | No | Raise monthly cap under Billing. |
| 403 | missing_scope | No | Use a key with search:read. |
| 404 | corpus_not_found | No | Check the corpus slug or create it first. |
| 422 | invalid_request | No | Fix the field named in error.message. |
| 429 | rate_limited | Yes | Back off for Retry-After seconds. |
| 502 | inference_error | Yes | Transient inference error; retry with exponential backoff. |