Concepts
Documents, pages, blocks
Section titled “Documents, pages, blocks”A document is the file you upload or point to with url. Deskew identifies its type from the first bytes, never from the extension, and splits it into pages:
| File | What a page is |
|---|---|
| A PDF page | |
| Image (PNG, JPEG, TIFF, WebP, BMP, GIF, HEIC/HEIF) | One frame; multi-frame TIFF and GIF become one page per frame, up to 200 |
| DOCX, HTML, TXT | One page for the whole document |
| XLSX | One page per worksheet |
| CSV / TSV | One page |
| PPTX | One page per slide |
| EML / MSG | One page for headers and body, then one page per attachment page |
Every page is classified as a kind: digital (usable text layer), scanned (needs OCR), sheet, slide, email or text.
Each page produces blocks: typed regions in reading order (heading, paragraph, list_item, table, figure, caption, header, footer, formula, code, checkbox, key_value, other) with the page number, text, an optional bounding box normalised to 0–1 and a confidence. Tables are kept separately as cell grids and also rendered into the Markdown. Fields are key-value pairs or a schema-shaped object extracted from the whole document on request.
The merge step then assembles pages into one document: repeated running headers and footers are dropped, tables split across page breaks are joined, and the Markdown is concatenated with --- between pages. See the Result object for the exact JSON.
Engines
Section titled “Engines”No single model is best for every page, and the cheapest correct path for a born-digital PDF is to run no model at all. Deskew picks per page:
Engine (page_results[].engine) |
Used for | Bounding boxes |
|---|---|---|
text-layer |
PDF pages with a usable text layer | Exact, from the PDF |
office |
DOCX, XLSX, CSV, PPTX, parsed from their XML | Slides only (shape positions) |
email |
EML and MSG headers and body | None |
text |
HTML and plain text | None |
deskew-ocr |
Scanned pages, images, photos (tier 1 OCR) | Approximate (meta.bbox_source: "vlm-approx") |
premium |
Low-confidence pages, handwriting, quality=premium, and all fields / schema extraction (tier 2) |
Approximate |
Routing
Section titled “Routing”- Office, email, HTML, CSV and text go straight to their parser.
- For a PDF, each page is checked for a text layer: characters extracted, share of the page covered by text, large images, font-less glyphs. Good coverage and non-garbage text means
digital; otherwisescanned. A digital page whose text layer turns out empty is re-routed to OCR. - Scanned pages are scored for quality (effective resolution, blur, contrast, skew angle), deskewed and rotated, then sent to OCR.
- Every OCR result is validated: repetition loops, implausible output length, replacement characters, empty output. A failed check triggers one retry with image enhancement (contrast equalisation, denoise, upscale). If it still fails and the plan allows, the page is escalated to the
premiumengine. If nothing helps, the page is returned withlow_confidence: trueand a warning, never silently.
The quality knob
Section titled “The quality knob”quality |
Behaviour on scanned pages |
|---|---|
auto (default) |
Tier 1. Pages with a very poor quality score, or any page when handwriting=true, go straight to premium on paid plans. Escalation on low confidence is on. |
fast |
Tier 1 only. No escalation, ever. |
accurate |
Same as auto today; the name is reserved for a stricter re-check threshold. |
premium |
premium for every scanned page (Pro and above; Free plan falls back to tier 1). |
Escalation and premium need a paid plan. On the Free plan a doubtful page is flagged, not escalated.
Credits
Section titled “Credits”Credits are what plans meter. Usage is reported on every result (usage.credits) and on every job (credits.estimated, credits.used).
| Item | Credits |
|---|---|
| PDF page, image frame, DOCX, email body | 1 per page |
| Spreadsheet (XLSX sheet or CSV) | 1 per 50 rows, minimum 1 per sheet |
| Slide | 1 each |
| HTML / TXT | 1 per 3,000 characters, minimum 1 |
quality=premium |
+2 per scanned page |
handwriting=true |
+2 per scanned page |
fields=true or schema=… |
+2 per page |
An estimate is computed before processing from the page plan and is what quotas are checked against; credits.used is the actual figure after processing. A page that escalates to premium on its own does not cost extra; only the options you ask for do.
Sync or async
Section titled “Sync or async”Small requests are processed while the connection is open and answered with 200 and the result. Larger ones are queued and answered with 202 and a job. The decision is made on work units, not page count:
- a digital page is 1 work unit, a scanned page is 4;
- the request is synchronous if total work ≤ 12 and the file ≤ 20 MB;
- otherwise it is asynchronous. The hard cap for an async upload is 500 MB; PDFs over 2,000 pages are rejected with
too_many_pages.
So a 12-page digital contract is sync, a 3-page scan is sync, a 4-page scan is async. For PDFs the quick check classifies at most the first 12 pages; anything longer is async regardless.
mode lets you override:
mode |
Effect |
|---|---|
auto (default) |
The rule above |
async |
Always queue, respond 202 |
sync |
Insist on an inline response; if the request is not eligible you get 413 sync_limit_exceeded instead of a job |
Every request, sync or async, creates a job with a ULID id such as job_01JE4K9QW2M3N4P5Q6R7S8T9V0. Jobs move through queued → processing → completed | failed | canceled. A job fails only when ingestion or the whole document fails; individual pages that cannot be read are counted in pages.failed and the job still completes. Results are stored for 24 hours, then deleted. See Background jobs.
Test and live
Section titled “Test and live”Keys, jobs, usage, webhooks and logs exist in two separate modes, test and live, selected by the key you call with. The dashboard has a Test / Live switch that shows one mode at a time. Test is free and capped at 50 pages a day per key. See Authentication.