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.
Overview
Upload a scan or image; get the text back inline, or a searchable-PDF download URL. Billed per page.
https://api.bytefuse.in/api/v1/ocrThis tool requires authentication
Unlike the light tools, OCR is not on the free-try path — an anonymous call returns401. Send a dt_live_ key or a JWT.Request
Content type multipart/form-data:
filefilerequired.pdf .png .jpg .jpeg .tif .tiff .bmp .webp — anything else returns 415.languagestringoptionaleng, spa). An uninstalled language returns 422.Default: engoutputstringoptionaltext (extracted text inline) or pdf (a searchable-PDF R2 URL). Any other value returns 422.Default: textenginestringoptionaltesseract (standard) or vision (premium AI). Any other value returns 422.Default: tesseractEngines & pricing
Billing is per page. The premium rate applies only when the AI path actually runs:
engine=vision with output=pdfocr.extract20engine=vision and output=textocr.extract.ai100Vision 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:
{
"success": true,
"pages": 3,
"credits_charged": 60,
"text": "…full extracted text…"
}{
"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
output or engine is an invalid value, the language isn’t installed, or the PDF is password-protected.To turn a PDF into LLM-ready Markdown instead, see PDF to Markdown.
