2xx status means success; 4xx means a problem with the request you can fix; 5xx means a problem on our side that’s usually safe to retry.
Error format
Every error response has the same JSON shape:detail field is a human-readable description of what went wrong.
Status codes
Handling errors
Don’t retry — fix the request
400, 401, 402, 413, and 422 indicate something about the request that won’t change on retry. Resolve the underlying cause instead:
400— confirm the file is a supported, uncorrupted PDF or image.401— send a validAuthorization: Bearer sk-pr-...header.402— top up your credits.413— split the document into files of 100 pages or fewer.422— check you’re sendingmultipart/form-datawith afilefield.
Safe to retry
429 and 503 are temporary. Both include a Retry-After header (in seconds) indicating how long to wait before trying again:
429— you’re sending requests too quickly. Wait forRetry-After, then retry. Add exponential backoff for production traffic.503— the backend is briefly saturated. Wait forRetry-Afterand retry. No credits are charged for a503.
Failed requests never consume credits — you’re only charged when a parse succeeds with a
200.