Skip to main content

Error envelope

Every error response uses the same shape:
  • code - stable, machine-readable; branch on this.
  • message - human-readable.
  • details - present on validation errors (400); the offending fields and why they failed.

Common codes

Job failures vs request errors

The errors above are returned by the HTTP request itself. A generation that starts but fails returns 200 with a terminal job whose status is failed:
Job-level error.code is one of GENERATION_FAILED or EXTRACTION_FAILED.

Handling guidance

  • 402 → top up credits / upgrade before retrying.
  • 429 → honor Retry-After and back off (Rate limits).
  • 400 → fix the request using details; don’t blind-retry.
  • 5xx → retry with exponential backoff (use an Idempotency-Key on creates).