Skip to main content
Reference for every error envelope, code, HTTP status, and retry policy returned by the Priors API.

The error format

Every error response returns the same three fields:
Always branch on code, not only on HTTP status. Two errors can share the same status code and need different actions.

Two errors any call can return

  • 401 unauthorized: your key is missing, unknown, revoked, or expired, or the person who created a personal key left the organization.
  • 503 service_unavailable: a Priors component did not respond, or the agent is restarting. Wait a few seconds and retry.

Every error code

Retry rules

  1. 429 rate_limit_exceeded: wait at least Retry-After seconds, then retry.
  2. Transient 5xx (service_unavailable, answer_model_unavailable, document_service_unavailable, ocr_failed, document_pages_unexpected, ocr_busy): retry with exponential backoff starting at 1 s (or 60 s for ocr_busy), up to 5 attempts. Reuse Idempotency-Key so you are never double-charged.
  3. 409 agent_not_ready: poll GET/v2/agents/ until ready, then retry.
  4. All other 4xx, 500, and service_not_configured: do not retry unchanged. Fix the request or inspect request_id.