Error format
All errors return a consistent JSON shape:Error codes
| Code | HTTP Status | Description |
|---|---|---|
bad_request | 400 | Invalid request body or parameters |
unauthorized | 401 | Missing or invalid API key |
forbidden | 403 | Valid key but not authorized for this resource |
not_found | 404 | Job or document does not exist |
rate_limit_exceeded | 429 | Too many requests - see rate limits |
insufficient_credits | 402 | Insufficient credit balance — add credits |
job_not_ready | 400 | Job is still processing — poll status before fetching results |
chat_failed | 500 | Document chat processing failed |
internal_error | 500 | Unexpected server error |
Handling errors
Retry strategy
For transient errors (429, 500, 502, 503), use exponential backoff:
Non-retryable errors
| Code | Action |
|---|---|
400 | Fix your request body or parameters |
401 | Check your API key |
402 | Add credits to your account |
403 | Verify you own the resource |
404 | Verify the job ID exists |
Common mistakes
Missingfilename with file_base64
filename in the request body.
Fetching results before completion
GET /api/v1/jobs/{jobId} until status is completed.
Invalid URL
http:// or https://.