Mistral OCR Service
Learn how to use the Mistral OCR Service to perform Optical Character Recognition (OCR) and text extraction using Mistral's document processing API.
Overview
The Mistral OCR Service is a document processing service that performs Optical Character Recognition (OCR) and text extraction using Mistral's document processing API. The service provides high-quality text extraction from various document formats with configurable processing options.
Endpoints
Extract Text
The extract text endpoint performs OCR and text extraction from documents using Mistral's document processing API.
API Endpoint
Endpoint Parameters
Here is an overview of the parameters that are used by the endpoint for text extraction.
Request
file_content
(string, required)
Base64 encoded content of the file to process. Must be properly encoded and within size limits.
file_type
(string, required)
MIME type of the file. Supported types:
application/pdf
: PDF documentsimage/png
: PNG imagesimage/jpeg
: JPEG images
model_id
(string, optional)
The specific Mistral model to use for text extraction. Default: "mistral-large-ocr"
options
(object, optional)
Additional processing parameters:
language
(string): Preferred language for text extractionocr_mode
(string): Processing modefast
: Quicker processing with standard accuracyaccurate
: Higher accuracy with longer processing time
include_metadata
(boolean): Include document metadata in response Default: false
Response
status
(string)
Status of the text extraction process:
success
: Processing completed successfullyerror
: Processing failed
result
(object)
Contains the extraction results:
text
(string): Extracted text contentmetadata
(object):model
(string): Model used for extractioncreated_at
(string): Processing timestampfile_type
(string): Detected file typepage_count
(integer): Number of pages processedprocessing_time
(number): Processing duration in seconds
error
(string)
Error message if processing failed
Examples
Below are examples demonstrating different ways to use the OCR service.
Request
Basic Text Extraction
Advanced Processing Options
Response
Successful Extraction
Error Response