Skip to main content
Source must be a URL (https://) or base64-encoded document.

Setup

export MISTRAL_API_KEY=your-key

Usage

from praisonaiagents import OCRAgent

agent = OCRAgent()
text = agent.read("https://arxiv.org/pdf/2201.04234")
print(text)

With Options

result = agent.extract(
    "https://example.com/document.pdf",
    pages=[0, 1, 2],  # 0-indexed
    include_image_base64=True
)
for page in result.pages:
    print(page.markdown)

Models

ModelDescription
mistral/mistral-ocr-latestLatest OCR (default)