Typed JSON from documents, with receipts.
Define a schema, paste a document or drop in a PDF, and get validated JSON where every value cites the exact span it came from. Fields the document doesn't contain come back null, never a plausible guess.
Next.js · Zod · OpenAI structured outputs
…LP-2210Matte labels, 3 × 4 in, roll of 500638.50231.00
…Rush production fee1120.00120.00
- "line_items[1].unit_price":
- 38.5
- "line_items[1].amount":
- 231
- "line_items[3].sku":
- null
Three things can come back
Backed by the document
citedEvery value carries the exact quote it came from. The quote is located in the source before the value is accepted.
Silent means null
not foundIf the document doesn't state a field, it comes back null and renders as not found. No guess from what a contract usually says.
No quote, no value
discardedA value whose quote can't be found in the source, or that fails its declared type, is thrown away and shown as rejected.
Document
Five line items, every cell cited. One row has no SKU, and there's no PO number on the invoice — both come back null.