Skip to main content
Use Cases
  • 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

Use POST /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

The document 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 extracted markdown and images, and a usage object counting pages or tokens processed. See the Create OCR reference for the full schema.

Supported models

For the current list of OCR models, see OCR models on the Supported Models page.