ocr_extract
Extract structured JSON data from document images (receipts, invoices, IDs). Uses built-in templates or custom field schemas, returning verified per-character bounding boxes.
Instructions
Extract structured data from a document image (receipt, invoice, ID, etc.) using space-ocr. Returns JSON with extracted fields plus verified per-character bounding boxes (re-anchored to Vision API symbols, not LLM-hallucinated). Provide either template_id for built-in document types, or fields for custom schemas.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Image as a public URL, a local file path, base64 string, or data URI. Local file paths are auto-encoded to base64. | |
| fields | No | Custom field schema. Each item has { name, type: 'string'|'array', description, children? }. Required when template_id is not provided. | |
| prompt | No | Optional natural-language hint for the AI (overrides template prompt). | |
| template_id | No | Built-in template id. Use this for common documents — fields and prompt are auto-resolved. Call list_templates() to see all options. | |
| language_hints | No | BCP-47 language codes prioritised by the OCR engine (e.g. ['ko','ja']). English is always auto-included. |