Smart OCR
Scans in, rows and fields out
Send a scan or a PDF. Get the text in reading order, tables as rows and the fields of your schema, each with a confidence score.
invoice-2026-114.pdf
fields
invoice_numberstring"2026-114"page 10.99billed_tostring"Larkspur Studio"page 10.98subtotalnumber950page 10.98taxnumber190page 10.97totalnumber1140page 10.98
tables[0]
| Item | Qty | Unit price | Amount |
|---|---|---|---|
| Design review | 2 | 250.00 | 500.00 |
| Hosting setup | 1 | 450.00 | 450.00 |
Plain OCR loses the layout. This keeps it, block by block.
Plain OCR returns a wall of text. Two-column pages come out in the wrong order, tables lose their columns, and you still write parsing code to find the invoice total.
Drag the handle. The numbers run in reading order: down the left column, then the right. In this sample the handwritten note scores lowest, so your code can send it to a person.
Who it is for
- Accounts payable tools that turn supplier invoices into line items and totals
- Back offices digitizing scanned contracts and forms, handwritten notes included
- Search and retrieval pipelines that need clean Markdown from PDFs with tables intact
Pick a document. See what comes back.
invoice-2026-114.pdfpage 1 of 1
Your code picks this number. The API only reports the confidence.
0 / 5 go to a person
invoice_numberstring"2026-114"page 10.99billed_tostring"Larkspur Studio"page 10.98subtotalnumber950page 10.98taxnumber190page 10.97totalnumber1140page 10.98
Blocks in reading order. Pick one to find it on the page.
| Item | Qty | Unit price | Amount |
|---|---|---|---|
| Design review | 2 | 250.00 | 500.00 |
| Hosting setup | 1 | 450.00 | 450.00 |
{
"data": {
"pages": 1,
"markdown": "# Invoice 2026-114\n\nBilled to: Larkspur Studio\n\n| Item | Qty | Unit price | Amount |\n| --- | --- | --- | --- |\n| Design review | 2 | 250.00 | 500.00 |\n| Hosting setup | 1 | 450.00 | 450.00 |\n\nSubtotal: 950.00\n\nTax: 190.00\n\nTotal: 1,140.00",
"blocks": [
{
"page": 1,
"index": 0,
"type": "heading",
"bbox": [
0.08,
0.05,
0.5,
0.09
],
"text": "Invoice 2026-114",
"confidence": 0.99
},
{
"page": 1,
"index": 1,
"type": "key_value",
"bbox": [
0.08,
0.12,
0.6,
0.15
],
"text": "Billed to: Larkspur Studio",
"confidence": 0.98
},
{
"page": 1,
"index": 2,
"type": "table",
"bbox": [
0.08,
0.2,
0.92,
0.42
],
"text": "Item | Qty | Unit price | Amount\nDesign review | 2 | 250.00 | 500.00\nHosting setup | 1 | 450.00 | 450.00",
"confidence": 0.96
},
{
"page": 1,
"index": 3,
"type": "key_value",
"bbox": [
0.6,
0.46,
0.92,
0.49
],
"text": "Subtotal: 950.00",
"confidence": 0.98
},
{
"page": 1,
"index": 4,
"type": "key_value",
"bbox": [
0.6,
0.5,
0.92,
0.53
],
"text": "Tax: 190.00",
"confidence": 0.97
},
{
"page": 1,
"index": 5,
"type": "key_value",
"bbox": [
0.6,
0.54,
0.92,
0.57
],
"text": "Total: 1,140.00",
"confidence": 0.98
}
],
"tables": [
{
"page": 1,
"bbox": [
0.08,
0.2,
0.92,
0.42
],
"header": [
"Item",
"Qty",
"Unit price",
"Amount"
],
"rows": [
[
"Design review",
"2",
"250.00",
"500.00"
],
[
"Hosting setup",
"1",
"450.00",
"450.00"
]
]
}
],
"fields": {
"invoice_number": {
"value": "2026-114",
"confidence": 0.99,
"page": 1
},
"billed_to": {
"value": "Larkspur Studio",
"confidence": 0.98,
"page": 1
},
"subtotal": {
"value": 950,
"confidence": 0.98,
"page": 1
},
"tax": {
"value": 190,
"confidence": 0.97,
"page": 1
},
"total": {
"value": 1140,
"confidence": 0.98,
"page": 1
}
}
},
"meta": {
"request_id": "3f1c9a52-7d4e-4b8a-9e21-6c0d5b7a8f13",
"version": "1",
"engine": "native",
"module": "ocr",
"units": 1
}
}{
"source": {
"upload_id": "3b0d6c2e-8a4f-4f7e-9c51-2d7a1e6b9f30"
},
"output": "markdown",
"schema": {
"type": "object",
"properties": {
"invoice_number": {
"type": "string"
},
"billed_to": {
"type": "string"
},
"subtotal": {
"type": "number"
},
"tax": {
"type": "number"
},
"total": {
"type": "number",
"description": "Amount due, tax included"
}
}
}
}Nothing here calls the API. Only the invoice with no schema is the documented example. The other documents, every field result and their confidences are written by hand to show the shape: illustrations, not measurements.
Upload, then extract. Plain HTTP, JSON in and out.
Both calls take the same key in the x-api-key header. A public https URL also works as the source. Branch on error.code, never on the message.
POST/v1/uploadsSend filename, content_type and size_bytes. You get an upload_id and a signed upload_url, valid for 2 hours. PUT the bytes there: a stored file that is not exactly size_bytes long ends the upload as failed, and you create a new one.
- Answers
- Sync
- Meter
Not metered
POST/v1/ocr/extractReads the document and returns its blocks and tables, plus text or Markdown and the fields of your schema when you ask for them.
- Answers
- Sync
- Meter
ocr.pages
Request
POST/v1/ocr/extractSynchronous: the response carries the result.
curl -X POST "$BASE_URL/v1/ocr/extract" \
-H "x-api-key: sk_live_..." \
-H "content-type: application/json" \
-d '{"source": {"upload_id": "3b0d6c2e-8a4f-4f7e-9c51-2d7a1e6b9f30"}, "output": "markdown"}'const res = await fetch(process.env.BASE_URL + "/v1/ocr/extract", {
method: "POST",
headers: { "x-api-key": "sk_live_...", "content-type": "application/json" },
body: JSON.stringify({
source: { upload_id: "3b0d6c2e-8a4f-4f7e-9c51-2d7a1e6b9f30" },
output: "markdown",
schema: {
type: "object",
properties: {
invoice_number: { type: "string" },
total: { type: "number", description: "Amount due, tax included" },
},
},
}),
});
const { data, meta } = await res.json();
console.log(data.fields.total.value, data.fields.total.confidence, meta.units);import os, requests
res = requests.post(
os.environ["BASE_URL"] + "/v1/ocr/extract",
headers={"x-api-key": "sk_live_..."},
json={
"source": {"upload_id": "3b0d6c2e-8a4f-4f7e-9c51-2d7a1e6b9f30"},
"output": "text",
"pages": [1, 2],
},
)
body = res.json()
print(body["data"]["text"], body["meta"]["units"])What you are billed for
- Unit
- pages
- Counted as
- Document pages processed.
- Rounding
- Whole pages, charged before processing: the pages you list, or 1 page up front when you list none, settled to the processed page count afterwards. A processing failure refunds the charge.
- Trial on approval
- 150 pages
Sample responses
{
"data": {
"pages": 1,
"markdown": "# Invoice 2026-114\n\nBilled to: Larkspur Studio\n\n| Item | Qty | Unit price | Amount |\n| --- | --- | --- | --- |\n| Design review | 2 | 250.00 | 500.00 |\n| Hosting setup | 1 | 450.00 | 450.00 |\n\nSubtotal: 950.00\n\nTax: 190.00\n\nTotal: 1,140.00",
"blocks": [
{
"page": 1,
"index": 0,
"type": "heading",
"bbox": [
0.08,
0.05,
0.5,
0.09
],
"text": "Invoice 2026-114",
"confidence": 0.99
},
{
"page": 1,
"index": 1,
"type": "key_value",
"bbox": [
0.08,
0.12,
0.6,
0.15
],
"text": "Billed to: Larkspur Studio",
"confidence": 0.98
},
{
"page": 1,
"index": 2,
"type": "table",
"bbox": [
0.08,
0.2,
0.92,
0.42
],
"text": "Item | Qty | Unit price | Amount\nDesign review | 2 | 250.00 | 500.00\nHosting setup | 1 | 450.00 | 450.00",
"confidence": 0.96
},
{
"page": 1,
"index": 3,
"type": "key_value",
"bbox": [
0.6,
0.46,
0.92,
0.49
],
"text": "Subtotal: 950.00",
"confidence": 0.98
},
{
"page": 1,
"index": 4,
"type": "key_value",
"bbox": [
0.6,
0.5,
0.92,
0.53
],
"text": "Tax: 190.00",
"confidence": 0.97
},
{
"page": 1,
"index": 5,
"type": "key_value",
"bbox": [
0.6,
0.54,
0.92,
0.57
],
"text": "Total: 1,140.00",
"confidence": 0.98
}
],
"tables": [
{
"page": 1,
"bbox": [
0.08,
0.2,
0.92,
0.42
],
"header": [
"Item",
"Qty",
"Unit price",
"Amount"
],
"rows": [
[
"Design review",
"2",
"250.00",
"500.00"
],
[
"Hosting setup",
"1",
"450.00",
"450.00"
]
]
}
]
},
"meta": {
"request_id": "3f1c9a52-7d4e-4b8a-9e21-6c0d5b7a8f13",
"version": "1",
"engine": "native",
"module": "ocr",
"units": 1
}
}{
"data": {
"pages": 1,
"blocks": [
{
"page": 1,
"index": 0,
"type": "heading",
"bbox": [
0.08,
0.05,
0.5,
0.09
],
"text": "Invoice 2026-114",
"confidence": 0.99
}
],
"tables": [],
"fields": {
"invoice_number": {
"value": "2026-114",
"confidence": 0.99,
"page": 1
},
"billed_to": {
"value": "Larkspur Studio",
"confidence": 0.98,
"page": 1
},
"subtotal": {
"value": 950,
"confidence": 0.98,
"page": 1
},
"tax": {
"value": 190,
"confidence": 0.97,
"page": 1
},
"total": {
"value": 1140,
"confidence": 0.98,
"page": 1
}
}
},
"meta": {
"request_id": "3f1c9a52-7d4e-4b8a-9e21-6c0d5b7a8f13",
"version": "1",
"engine": "native",
"module": "ocr",
"units": 1
}
}validation_error400The body has an unknown field, no source, more than 50 pages listed, a page past the end of the document (issue code page_out_of_range), or a schema property named __proto__, constructor or prototype.
unauthorized401The x-api-key header is missing, wrong or revoked.
forbidden403The key or the account has no access to this resource.
not_entitled403Your plan does not include Smart OCR.
quota_exceeded403The pages left this period do not cover the call. details holds the meter and the remaining pages.
not_found404The upload_id does not exist or belongs to another account.
payload_too_large413The JSON body is over 2 MB. Send files through an upload instead.
rate_limited429The key sent more requests than its per-minute limit. details holds retry_after_seconds.
internal_error500Something failed on our side.
provider_error502Processing failed. The charge is refunded and the call can be retried.
Six stages, one page. A field that scores low goes around again.
Send a PDF or an image and get back the text in reading order, every table as a header and rows, and the fields you describe in a schema. Each block and each field carries its place on the page and a confidence score, so your code decides what a person should check.
Steps, in order:
- PDF or image (input)
- Render, deskew, denoise (check)
- Model registry (store)
- Layout and reading order (model)
- Line recognizer (model)
- Table rebuild (check)
- Schema field extractor (model)
- Text, blocks, tables, fields (output)
Connections:
- PDF or image to Render, deskew, denoise
- Render, deskew, denoise to Layout and reading order
- Model registry to Layout and reading order: weights
- Layout and reading order to Line recognizer
- Line recognizer to Table rebuild
- Line recognizer to Schema field extractor
- Schema field extractor to Line recognizer: low confidence: higher-resolution pass
- Table rebuild to Text, blocks, tables, fields
- Schema field extractor to Text, blocks, tables, fields
01 · prepare
Render and clean each page
PDF pages are rendered to images. Every page is deskewed and denoised before any model sees it.
- Runs on
- CPU worker
- In and out
- PDF or image -> page images
02 · layout
Find blocks and reading order
A layout detector marks headings, paragraphs, lines, key-value pairs, tables, figures and handwriting, then orders them the way a person would read the page.
- Runs on
- Our GPU nodes
- In and out
- page image -> blocks[] with bbox and index
03 · recognize
Read the lines
Line detection feeds our own recognizer, which has a separate head for handwriting. Each block gets its text and a confidence from 0 to 1.
- Runs on
- Our GPU nodes
- In and out
- blocks[] -> text per block, confidence
04 · tables
Rebuild tables
Table blocks are split into a header and rows with the same column count, so a line item stays on its row.
- Runs on
- CPU worker plus a small structure model
- In and out
- table blocks -> tables[] with header and rows
05 · fields
Fill your schema
When you send a schema, the extractor fills each property from the recognized blocks and records the page it came from. A field with low confidence gets a second pass on a higher-resolution crop.
- Runs on
- Our GPU nodes
- In and out
- schema + blocks[] -> fields{value, confidence, page}
06 · assemble
Return one response
Joins text or Markdown in reading order, attaches blocks, tables and fields, and settles the charge to the pages processed.
- Runs on
- API node
- In and out
- results -> JSON response
Where it stops. Hard limits.
- 50
- pages per call
- 50 MiB
- per uploaded file
- 50
- flat fields per schema
- Sync
- no job mode in this version
- Up to 50 pages per call. Read longer PDFs in ranges with the pages field, one call per range.
- Files up to 50 MiB through an upload, as PNG, JPEG, WebP, TIFF or PDF. The stored file must be exactly the size_bytes you declared, or the upload ends as failed.
- A schema holds up to 50 flat fields typed as string, number, integer or boolean. Nested objects and lists are not supported in this version, and the names __proto__, constructor and prototype are refused.
- The call is synchronous and returns after the last page is read. There is no job mode for OCR in this version.
- We print no accuracy figure. Route on the confidence scores.
Offline, between releases. How the models get retrained.
- 01Label a fixed document set with blocks, reading order, tables and fields
- 02Fine-tune the layout detector and the recognizer on it
- 03Preference-tune the field extractor on rejected extractions
- 04Register the new weights
- 05Run the weekly benchmark on a fixed external document set
Then back to step 1, with the next labeled set
Prices. One page price covers text, tables and fields.
The layout detector, the recognizer and the field extractor are open models we tune and run on our own servers. No page is passed to a hosted model API, so a page costs what it costs us to run, plus a margin.
| Starter | Pro | Scale | |
|---|---|---|---|
| Price | $5/month | $19/month | $49/month |
| Included | 3,000 pages | 20,000 pages | 100,000 pages |
| Limits | No extra limits | No extra limits | No extra limits |
| Fits | About 100 pages a day over a 30-day month, such as one team's incoming invoices | About 660 pages a day, such as a product feature that reads documents your users upload | About 3,300 pages a day, such as batch digitization of an archive |
Smart OCR tiers, billed monthly
Starter
- Price
- $5/month
- Included
- 3,000 pages
- Limits
- No extra limits
- Fits
- About 100 pages a day over a 30-day month, such as one team's incoming invoices
Pro
- Price
- $19/month
- Included
- 20,000 pages
- Limits
- No extra limits
- Fits
- About 660 pages a day, such as a product feature that reads documents your users upload
Scale
- Price
- $49/month
- Included
- 100,000 pages
- Limits
- No extra limits
- Fits
- About 3,300 pages a day, such as batch digitization of an archive
Over the quota: write to us and we can raise it, or it resets next period.
All six APIs are also sold together as one bundle: $19 a month with every Starter quota, $49 with every Pro quota, $129 with every Scale quota. See the bundle on the pricing page
Before you apply. What to check first.
How accurate is it on my documents?
- We print no accuracy figure. Every block and every field carries a confidence from 0 to 1, and a field that was not found comes back as null instead of a guess.
My PDFs run to hundreds of pages.
- One call reads up to 50 pages. Pass the pages field to pick a range and send one call per range. Each call is charged for the pages it processed.
What happens to the documents I upload?
- Uploads go to private storage through a signed link that accepts the file for 2 hours, and other accounts cannot reference them.
What happens when I run out of pages?
- The call stops before any processing with quota_exceeded, and details tells you the meter and the pages left. Nothing is charged. Write to us and we can raise the quota, or it resets next period.
OCR that keeps the table's columns
Send an application and we review it within 72 hours. Approved accounts get credentials and a small trial, and we send invoices by hand.