Bytefusedocs

Extract

OCR

Read text out of scanned PDFs and images — return it as plain text, or as a searchable PDF with an invisible text layer. Standard Tesseract, or a premium AI vision engine for hard scans.

Login required 20 credits / pageAI vision: 100 / pageSynchronous

Overview

Upload a scan or image; get the text back inline, or a searchable-PDF download URL. Billed per page.

POSThttps://api.bytefuse.in/api/v1/ocr

This tool requires authentication

Unlike the light tools, OCR is not on the free-try path — an anonymous call returns 401. Send a dt_live_ key or a JWT.

Request

Content type multipart/form-data:

filefilerequired
A scanned PDF or image. Allowed extensions: .pdf .png .jpg .jpeg .tif .tiff .bmp .webp — anything else returns 415.
languagestringoptional
Tesseract language code (e.g. eng, spa). An uninstalled language returns 422.Default: eng
outputstringoptional
text (extracted text inline) or pdf (a searchable-PDF R2 URL). Any other value returns 422.Default: text
enginestringoptional
tesseract (standard) or vision (premium AI). Any other value returns 422.Default: tesseract

Engines & pricing

Billing is per page. The premium rate applies only when the AI path actually runs:

ConditionCost / page
Tesseract (default) — or engine=vision with output=pdfocr.extract20
engine=vision and output=textocr.extract.ai100

Vision is text-only, and never returns empty

engine=vision only changes the result for output=text; a searchable PDF always uses Tesseract (and is billed at the standard rate). If the vision model fails or isn’t configured, it falls back to Tesseract page-by-page. A 10-page scan with engine=vision, output=text costs 10 × 100 = 1,000 credits.

Response

200 OK, application/json. The shape depends on output:

output=text
{
  "success": true,
  "pages": 3,
  "credits_charged": 60,
  "text": "…full extracted text…"
}
output=pdf
{
  "success": true,
  "pages": 3,
  "credits_charged": 60,
  "url": "https://<r2-host>/ocr/<date>/<uuid>_searchable.pdf"
}

text joins per-page text with a form-feed separator; url is a public R2 link to the searchable PDF. For output=text, pages that already have a digital text layer are read directly (instant and exact) — only image-only pages are OCR’d. The X-Credits-Charged header mirrors credits_charged.

Examples

curl -X POST https://api.bytefuse.in/api/v1/ocr \
  -H "X-API-Key: dt_live_your_key" \
  -F "file=@scan.pdf" \
  -F "language=eng" \
  -F "output=text" \
  -F "engine=vision"

Errors

401Anonymous / not signed in — OCR is login-only.
415The file extension isn’t a supported image or PDF type.
422output or engine is an invalid value, the language isn’t installed, or the PDF is password-protected.
400Unreadable file or undetectable type.
402 / 429 / 503Insufficient credits, rate limited, or capacity/config error.
500OCR processing failed unexpectedly.

To turn a PDF into LLM-ready Markdown instead, see PDF to Markdown.