- Extracting text and layout from scanned PDFs and images.
- Digitizing receipts, invoices, and forms into structured markdown.
- Preprocessing documents for downstream RAG or analytics pipelines.
- Turning uploaded files into searchable, machine-readable content.
Overview
UsePOST /v3/router/ocr on the AI Gateway to run OCR on a document or image. The endpoint returns per-page markdown that preserves document structure and hierarchy, along with any extracted images.
For the full request and response schema, see the Create OCR API reference.
Quick start
Send a document URL or image URL and specify the OCR model to use.Input types
Thedocument field accepts either a document URL or an image URL.
Options
Additional fields control which pages are processed and how images are returned.Response
Each response includes the model used, an array of pages with extractedmarkdown and images, and a usage object counting pages or tokens processed. See the Create OCR reference for the full schema.