Select pages
Use "all", an array such as [1,3,5], or ranges such as {"ranges":[{"start":1,"end":3}]}. Page numbers begin at one. The service determines page count from the completed upload.
Choose output
output.layout accepts ordered or grouped. Use output.include to select retained block kinds. Tables can be cells, markdown, or html. Header and footer inclusion and confidence detail are opt-in.
{"upload_id":"upl_...","mode":"ocr","pages":{"ranges":[{"start":1,"end":3}]},"output":{"layout":"ordered","include":["text","titles","tables"],"table_format":"cells","confidence":"block"}}Read a result view
GET /extractions/{id}/result supports view=ordered|grouped, comma-separated include or exclude, table_format=cells|markdown|html, and confidence=none|page|block|word.
Structured mode
Use mode: "structured" only with a valid JSON schema and bounded instructions. Standard pricing is USD 0.02 per page for all processing modes, with no structured-output or table surcharge. An approved tenant-specific price override may apply.
Structured request example
Complete the upload first, substitute its ID, and send this JSON to POST /extractions with a scoped bearer key and a new Idempotency-Key. The schema describes the JSON fields you want; instructions stay bounded to this extraction.
{
"upload_id": "upl_YOUR_COMPLETED_UPLOAD_ID",
"mode": "structured",
"pages": "all",
"schema": {
"type": "object",
"properties": {"invoice_number": {"type": "string"}},
"required": ["invoice_number"],
"additionalProperties": false
},
"instructions": "Extract the invoice number exactly as printed."
}The response is a durable job. Poll its status and fetch its result using the same flow as the OCR quickstart.