Skip to main content

Mistral: OCR

Run Mistral's OCR API on a document (passed as either a URL or a file). Returns the extracted page text, with optional structured annotation per bounding box and per document. Files with an unsupported extension are rejected before being uploaded to the provider.

Pre-requisite: Install a Mistral AI application from Profile > {Organization} > Applications.

Parameters

Applicationrequired
Configured Mistral AI application.
Model

OCR model identifier (e.g. mistral-ocr-latest). Defaults to mistral-ocr-latest.

Pages

Page selection expression (e.g. 0,1,2, 0-5, 0,2-4). When omitted, all pages are processed.

Pages as JSONL

When enabled, response pages are written to a JSONL file (one page per line) instead of an inline JSON object. Recommended for large documents.

Extract Header

When enabled, page headers are extracted as a separate field.

Extract Footer

When enabled, page footers are extracted as a separate field.

Table Format

Output format for detected tables: none, markdown, or html.

Include Image Base64

When enabled, every detected image is returned as base64 data inside the response. Significantly increases response size.

Embed image template

Optional. When set, every image reference in the page markdown (e.g. ![img-30.jpeg](img-30.jpeg)) is replaced inline by this template. {key} placeholders are substituted with the matching field from that image's annotation object (e.g. Image ({document_type}): {short_description}). Two reserved placeholders are also available: {id} (the image id) and {image_base64}, which expands to a data: URI of the inline image when Include Image Base64 is enabled — to embed the actual image, use e.g. ![{short_description}]({image_base64}). Any image lacking base64 data keeps its original markdown reference instead of being replaced.

Bbox Annotation Format

JSON Schema describing the structured annotation Mistral should return for each detected bounding box. Leave empty to skip bbox-level annotation.

Document Annotation Format

JSON Schema describing the structured annotation Mistral should return for the whole document. When set, the node also exposes the Document annotation output connector. Starter templates available: summary, table-of-contents, flat table-of-contents.

Document Annotation Prompt

Free-form prompt guiding the document-level annotation. Ignored when Document Annotation Format is empty.

Input

URL or Filerequired

Either a PlainText URL pointing to a publicly fetchable document, or a File containing the document directly. Files whose extension is not supported by Mistral OCR (documents: pdf, docx, doc, pptx, ppt, xlsx, csv, txt, epub, xml, rtf, odt, bib, fb2, ipynb, tex, opml, 1, man; images: jpg, jpeg, png, avif, tiff, gif, heic, heif, bmp, webp) cause the step to fail.

Output

Document pages

A File with the OCR result. When Pages as JSONL is enabled, it is a JSONL file with one page per line containing the extracted text and any enabled per-page extras (header, footer, tables, bbox annotations). Otherwise, it is a file containing the full OCR response as a single JSON object.

Document annotation

Only present when Document Annotation Format is set. JSON document matching the schema, summarizing the whole document.