Skip to main content
This page is the reference for errors. After you read it, you can read any error response, find its cause in the table, and know whether to correct the request or to wait and try again.

The format of an error

Every error response has the same three fields:
Make decisions in your code on code, not on the HTTP status. Two different errors can have the same status and need different handling.

Two errors that any call can return

  • 401 unauthorized: your key is missing, unknown, revoked, or expired. Check the key.
  • 503 service_unavailable: a part of Priors did not respond, or an agent is restarting after a restart of the service. The error text says which. Wait a few seconds, then send the same request again.
The tables on the other pages leave these two out.

Every error code

The table below lists every code, its status, its cause, and what to do.

Rate limit headers

When a request hits a limit, the response is 429 and has these headers: Wait at least Retry-After seconds. Do not try again in a tight loop.

Rules for trying again

  1. For 5xx with service_unavailable, answer_model_unavailable, document_service_unavailable, ocr_failed, document_pages_unexpected, or ocr_busy: wait, then try again. Double the wait after each failure, starting at one second. For ocr_busy, start at one minute. Stop after five tries.
  2. For 429: wait Retry-After seconds, then try again.
  3. For 409 with agent_not_ready: poll the agent, then try again when its status is ready.
  4. For every other 4xx: do not try again. Correct the request.
  5. For 500 and service_not_configured: do not try again. Contact us with the request_id.