extract_document
Extract STRUCTURED FIELDS from a document image: invoices, receipts, ID cards — or any custom JSON schema you supply. Every field returns {value, confidence, box} where the confidence and box come from the OCR geometry (never model guesswork); absent fields are null. preset="zatca" additionally decodes the Saudi ZATCA e-invoice QR (TLV) and cross-validates it against the printed fields — use it for Saudi tax invoices. Arabic-first accuracy. 5 credits/page (zatca 7).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language hint; default auto. | auto |
| preset | No | Built-in schema. Use zatca for Saudi e-invoices (adds QR validation). | |
| schema | No | Custom extraction schema instead of a preset: an object whose keys are the fields you want, values describing them, e.g. {"policy_number": "string|null"}. | |
| api_key | No | Optional Auto-Reader OCR key (nsk_live_...). If omitted, a free trial key is auto-provisioned and returned to you in the result. | |
| image_base64 | Yes | The document image as base64 (data: URI prefix accepted). |