Skip to content

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.

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

Currently, we offer two OCR endpoints:

Model IDDescriptionStatusRate LimitsRelease Date
typhoon-ocrTyphoon OCR 1.5 (2B)Latest & Recommended (Now default in our Web Playground)2 req/s, 20 req/min2025-11-14
typhoon-ocr-previewTyphoon OCR 1 (7B)Legacy2 req/s, 20 req/min2025-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.

Typhoon OCR model supports the following file formats:

  • Images: PNG, JPEG
  • Documents: PDF

To use our OCR model, you’ll need to:

  1. Install the required package:
Terminal window
pip install typhoon-ocr

Extra installation for…

Mac specific

brew install poppler
# The following binaries are required and provided by poppler:
# - pdfinfo
# - pdftoppm

Linux specific

sudo apt-get update
sudo apt-get install poppler-utils
# The following binaries are required and provided by poppler-utils:
# - pdfinfo
# - pdftoppm
  1. Set up your API key as an environment variable:
Terminal window
export TYPHOON_OCR_API_KEY=your_api_key_here
  1. 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 image
markdown = 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.

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)