v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
OCR

Perform OCR

Extracts text and content from documents or images using optical character recognition. Supports PDF URLs, base64-encoded documents, and image URLs.

post/v1/ocr

Request body

modelstring required

Model in provider/model format

idstring

Optional unique identifier for the request

fallbacksstring[]

Fallback models in provider/model format

include_image_base64boolean

Whether to include base64-encoded images in the response

pagesinteger[]

Specific page indices to process (0-based)

image_limitinteger

Maximum number of images to extract per page

image_min_sizeinteger

Minimum image size in pixels to extract

table_formatstring

Format for extracted tables (e.g., "markdown", "html")

extract_headerboolean

Whether to extract page headers

extract_footerboolean

Whether to extract page footers

confidence_scores_granularity'page' | 'block' | 'word' | 'document'

Granularity of confidence scores to include in the response

document_annotation_promptstring

Custom prompt for document annotation

Example request

{
  "model": "mistral/mistral-ocr-latest"
}

Response

Successful response

modelstring required

Model used to perform OCR

document_annotationstring

Document-level annotation if requested