Error format
All errors return a consistent JSON shape:Error codes
Handling errors
Retry strategy
For transient errors (429, 500, 502, 503, 504), use exponential backoff:
Non-retryable errors
Structured output errors
The/v1/documents/{id}/structured-output endpoint returns specific extraction errors:
Example error response
Tips for reliable extraction
- Keep schemas flat when possible — fewer nested objects means faster extraction
- Use string types for financial values (e.g.
"$215,938 million") rather than numbers to avoid parsing ambiguity - Check document status before extracting —
phase: "complete"is required