Skip to main content
Surya is a high-accuracy OCR provider from Datalab that extracts text with precise bounding boxes.

Installation

Basic Setup

Configuration Options

Usage with Flows

Output: DocumentIR

Surya returns a DocumentIR with text and bounding boxes:

Supported Formats

Input Methods

URL

Base64

Async Processing

Surya uses async processing for large documents. The SDK handles polling automatically:

Self-Hosted Deployment

Run Surya locally for reduced latency and cost:
Self-hosted endpoints are detected automatically and don’t require API keys.

Pricing

Cost is included in the response:

When to Use Surya

Use Surya when:
  • You need precise bounding boxes for citations
  • Processing text-heavy documents
  • Building RAG pipelines with positional data
  • You need OCR before LLM extraction
Consider VLM direct when:
  • Documents have complex visual layouts
  • Tables and forms are primary content
  • Speed is more important than OCR accuracy

Example: OCR + Extraction Pipeline

Next Steps

Marker OCR

Markdown conversion

Reducto

Chunking and splitting