Skip to main content
Version: 3.1

Mistral OCR

Mistral OCR converts PDF documents into Markdown through Mistral's /v1/ocr endpoint. Reaktors use it to extract text from uploaded or linked PDFs so that AI models can process the content. It is an alternative to Document Intelligence; both produce Markdown from a PDF.

You configure Mistral OCR as a Connection of type mistral-ocr under Connections in the sidebar.


API Configuration​

Connect to Mistral's OCR service with a Mistral API key.

FieldDefaultDescription
API KeyrequiredMistral API key for the OCR service. Create one at console.mistral.ai.
Modelmistral-ocr-latestMistral OCR model id.
Base URLhttps://api.mistral.aiMistral API base URL. Change only to route through a compatible endpoint.

Caching​

Every PDF is hashed before conversion. If the same document has been converted before, the cached result is returned without a Mistral API call. Caching happens in two layers:

  1. Database — primary cache, checked first.
  2. File Cache — gzipped files on disk, used as a fallback when the database cache misses.

Cache Key Prefix​

The optional Cache Key Prefix scopes the cache. The prefix is prepended to the document hash, so documents cached under different prefixes are treated as separate entries.

Use cases:

  • Set a prefix per organisation or Reaktor to isolate caches.
  • Change the prefix (e.g. from v1 to v2) to force re-conversion of all documents without deleting old cache entries.
  • Leave it empty to use the default (unprefixed) cache shared by all consumers.

File Cache​

FieldDefaultDescription
File Cache Directoryuploads/docs/convert-to-markdownLocal directory for storing converted documents as gzipped files.
Enable File CacheOnWhen enabled, the file cache is checked as a fallback if the database cache misses.

Timeout​

FieldDefaultDescription
Conversion Timeout3 minMaximum wait time for a single PDF conversion. Range: 10 000-600 000 ms.

Usage in Reaktors​

Reference the connection by name in your Reaktor code. The @operaide/document package provides two aktors:

AktorPurpose
aktorConvertPDFToMarkdownMistralConvert a single PDF (URL or base64) to Markdown
aktorConvertMultiplePDFsToMarkdownMistralConvert multiple PDFs to an array of Markdown strings

See Using Mistral OCR for the developer guide and examples.