OCR Model

OpenTyphoon.ai offers specialized OCR model optimized for Thai text recognition and document processing. Our OCR model is designed to handle various types of documents, images, and forms with high accuracy.
Features
Section titled “Features”Our OCR model includes the following capabilities:
- Extract text and layout information from PDFs and images
- Generate OCR-ready messages for API processing with Typhoon OCR model
- Built-in prompt templates for different document processing tasks
- Process specific pages from multi-page PDF documents
Available Models
Section titled “Available Models”Currently, we offer two OCR endpoints:
| Model ID | Description | Status | Rate Limits | Release Date |
|---|---|---|---|---|
typhoon-ocr | Typhoon OCR 1.5 (2B) | Latest & Recommended (Now default in our Web Playground) | 2 req/s, 20 req/min | 2025-11-14 |
typhoon-ocr-preview | Typhoon OCR 1 (7B) | Legacy | 2 req/s, 20 req/min | 2025-05-19 |
typhoon-ocr (Typhoon OCR 1.5) is the default and recommended endpoint for all new integrations.
typhoon-ocr-preview exposes the original Typhoon OCR v1 model to support existing workflows and will be deprecated on 31 December 2025.
Supported File Types
Section titled “Supported File Types”Typhoon OCR model supports the following file formats:
- Images: PNG, JPEG
- Documents: PDF
Getting Started
Section titled “Getting Started”To use our OCR model, you’ll need to:
- Install the required package:
pip install typhoon-ocrExtra installation for…
Mac specific
brew install poppler# The following binaries are required and provided by poppler:# - pdfinfo# - pdftoppmLinux specific
sudo apt-get updatesudo apt-get install poppler-utils# The following binaries are required and provided by poppler-utils:# - pdfinfo# - pdftoppm- Set up your API key as an environment variable:
export TYPHOON_OCR_API_KEY=your_api_key_here- Start using the OCR function:
By default, the ocr_document helper uses the latest typhoon-ocr endpoint (Typhoon OCR 1.5) and returns structured, layout-aware Markdown output.
For v1.5, the task_type parameter is no longer required.
from typhoon_ocr import ocr_document
# Process a specific page from a PDF (Typhoon OCR 1.5 via `typhoon-ocr`)markdown = ocr_document( pdf_or_image_path="document.pdf", # Works with PDFs or images page_num=2 # Process page 2 of a PDF (default is 1, always 1 for images))
# Or with an imagemarkdown = ocr_document( pdf_or_image_path="scan.jpg" # Works with PDFs or images)Note: The legacy typhoon-ocr-preview endpoint (Typhoon OCR v1) previously supported a task_type parameter for switching between two modes default or structure.
For new projects and most use cases, we recommend using typhoon-ocr (v1.5), which no longer requires task_type.
Example Usage
Section titled “Example Usage”Here’s a more detailed example of using the OCR model:
from typhoon_ocr import ocr_document
# Process a specific page from a PDF - If you want to process more than one page, you can construct a loop condition on your own.markdown = ocr_document( pdf_or_image_path="document.pdf", page_num=2)print(markdown)
# Process an image (layout-aware Markdown output)markdown = ocr_document( pdf_or_image_path="invoice.jpg")print(markdown)