Feature · OCR

OCR API for text, layout and tables

Turn a page image into structured JSON: text, reading order, tables, checkboxes and confidence flags. No separate OCR endpoint is required; the work runs on a vision model with a schema you control.

Short answer. Use plugsky-parse through POST /v1/chat/completions. Send one page per request as an image, give the model a JSON schema, and validate the result. The model has a 262,144-token context and up to 16,384 output tokens. Paid plans start at $8/month. There is no separate /v1/ocr endpoint, so do not build against one.

Classic OCR returns lines and words with bounding boxes. A vision model returns whatever you ask it to return: more structure and flexibility, but also more ways to get a plausible wrong answer. The call is chat completions with plugsky-parse, a 262,144-token context, up to 16,384 output tokens, image input, and paid plans from $8.

Printed, scanned and handwritten text

Digital PDFs should use the text layer where it exists; render only pages that have no text. Scans need deskew, border crop and about 300 dpi. Phone photos need perspective correction and glare removal. Handwriting is an uncertainty problem: ask for null when a field is unreadable and route every handwritten name or number to review. A missing field is cheaper than a wrong one.

Tables, checkboxes and reading order

Do not ask for “all the text”. Ask for a document object with a blocks array. Each block has a type, a bounding box, the content, and a reading-order index. Tables carry rows and cells; checkboxes carry a boolean and the printed label beside them.

import json
from openai import OpenAI

client = OpenAI(api_key="YOUR_PLUGSKY_KEY", base_url="https://api.plugsky.com/v1")

schema = {
  "type": "object",
  "required": ["blocks"],
  "properties": {"blocks": {"type": "array", "items": {
    "type": "object",
    "required": ["order", "type", "text"],
    "properties": {
      "order": {"type": "integer"},
      "type": {"enum": ["title", "paragraph", "table", "checkbox"]},
      "text": {"type": ["string", "null"]},
      "table": {"type": ["array", "null"], "items": {"type": "array", "items": {"type": "string"}}},
      "checked": {"type": ["boolean", "null"]}
    }}}}
}

resp = client.chat.completions.create(
    model="plugsky-parse",
    response_format={"type": "json_schema", "json_schema": {"name": "page", "schema": schema, "strict": True}},
    messages=[{"role": "user", "content": [
        {"type": "text", "text": "Transcribe this page. Preserve reading order. Use null for unreadable text."},
        {"type": "image_url", "image_url": {"url": "https://example.com/page-1.png"}},
    ]}],
)

page = json.loads(resp.choices[0].message.content)
assert [b["order"] for b in page["blocks"]] == sorted(b["order"] for b in page["blocks"])

The assertion catches out-of-order blocks. Also check that every table row has the same cell count as the header and that numeric columns parse as numbers.

Checkboxes need a different rule. Ask for the printed label and the state, then compare the label to a known list. A checkbox with no label is not a value; it is a review item. The same applies to signatures and stamps.

The 10-document benchmark

There is no honest single accuracy number for OCR; the score depends on the scan, language, layout and what you count as correct. Run this fixed set on your own documents.

#DocumentWhat to score
1One-column invoice, digital PDFField accuracy; line-item sums; currency
2Two-column invoice, scannedReading order; column separation
3Bank statement with a wide tableCell accuracy; row count; negative values
4Insurance claim form with checkboxesCheckbox state; label pairing
5Handwritten delivery noteName and quantity accuracy; null behaviour
6Rotated mobile photo of a receiptPerspective handling; total
7Arabic contract pageRight-to-left order; Arabic-Indic digits
8Mixed Arabic and English tableScript switching; column order
9Low-contrast faxCharacter error rate; missing lines
10Dense 10-K page with footnotesSection order; footnote linking

Score character error rate, field accuracy, table cell accuracy and review rate. The review rate converts directly into minutes, and a model that is slightly worse on characters but halves review time can be the better choice.

Language coverage and the Arabic test

Arabic is the test that separates a demo from a production OCR pipeline in the GCC. The script is right-to-left, letters change shape by position, diacritics are optional, and documents often mix Arabic with English brand names and Latin digits. Arabic-Indic digits (٠١٢٣٤٥٦٧٨٩) may appear beside Western digits in the same table.

  • Reading order: the first block should be the top-right, not the top-left.
  • Digits: decide whether to normalise to Western digits before comparison; store the original form too.
  • Diacritics: strip them for matching, but keep them in the stored text if the document is legal or religious.
  • Mixed lines: an English product name inside an Arabic sentence should stay in the correct visual position.

Run the same ten-document set in Arabic and compare field accuracy, not just character accuracy. If the Arabic review rate is more than twice the English rate, the pipeline is not ready for a bilingual queue.

Confidence and routing

A language model's token probabilities are not calibrated OCR confidence. Build confidence from checks you can explain: schema validation, arithmetic reconciliation, date and currency parsing, a second prompt pass, and overlap with a classic OCR engine. Store the signal, threshold and decision with every page.

Cost per 1,000 pages

Plugsky bills a flat plan, not a per-token rate, so effective cost per page is plan price divided by pages processed inside the cap. A 1024×1024 page image plus a schema prompt and JSON completion is roughly 1,300 tokens; denser pages cost more.

PlanDaily token capPages/day at 1.3k tokensEffective $ / 1,000 pages at full daily use
Hobby $82M~1,538~$0.17
Starter $205M~3,846~$0.17
Builder $60No token capConcurrency/RPM bound$60 ÷ pages per month
Scale $120No token capConcurrency/RPM bound$120 ÷ pages per month

The arithmetic: $8 per month is about $0.267 per day; 1,000 pages need 1.3M tokens, or 65% of Hobby's 2M daily cap, so the marginal cost is about $0.17. That is an estimate from published caps, not a measured benchmark. Add review cost: if 8% of pages need three minutes at $0.50/minute, that is $0.12 per page, which dwarfs the API cost. See pricing for current caps and RAG for PDFs for chunking.

FAQ

Is there a dedicated OCR endpoint?

No. OCR is a structured-output task on plugsky-parse through /v1/chat/completions. Send each page as an image, provide a JSON schema, and validate the response before storing it.

How accurate is the OCR?

Accuracy depends on scan quality, layout, language and handwriting. This page gives a 10-document benchmark you can run on your own corpus; it does not publish a single vendor accuracy score.

Does it handle Arabic?

Arabic is a core test for GCC documents. plugsky-parse is a multilingual vision model, but you should test right-to-left reading order, Arabic-Indic digits, diacritics and mixed English on your own pages before relying on it.

How do I extract tables and checkboxes?

Define a JSON schema with a blocks array. Each block carries a type such as paragraph, table or checkbox, its bounding box, and its content. Validate cell counts and boolean values after the call.

What does OCR cost per 1,000 pages?

It depends on tokens per page and your plan. At an estimated 1,300 tokens per page, Hobby's 2M daily token cap allows about 1,538 pages per day. The effective cost at full daily use is roughly $0.17 per 1,000 pages; the formula and plan table are above.

Sources

Mistral OCR documentation for table formats, block extraction and confidence granularity, checked 20 November 2026: docs.mistral.ai/capabilities/OCR/basic_ocr. Microsoft Document Intelligence layout documentation for tables, selection marks and reading order, checked 20 November 2026: learn.microsoft.com/azure/ai-services/document-intelligence/prebuilt/layout. OpenAI vision input documentation for image token behaviour, checked 20 November 2026: developers.openai.com/api/docs/guides/images-vision.

Reviewed 20 November 2026. Model limits were checked against the Plugsky catalogue. OCR accuracy varies by document; validate on your own corpus before production use, and review any Arabic or handwritten output before it reaches a system of record.