Mistral OCR (document to markdown)
mistral_ocrExtract text from PDFs or images using OCR, returning structured markdown per page with support for tables, headers, footers, and annotations.
Instructions
Run Mistral OCR on a PDF or image, returning structured markdown per page.
Input document is one of:
{ type: "document_url", documentUrl: "https://...pdf" }
{ type: "image_url", imageUrl: "https://..." | "data:image/..." }
{ type: "file", fileId: "" }
Options:
pages: array of 0-indexed page numbers or string like "0-5,7".tableFormat: 'markdown' (default) or 'html'.extractHeader/extractFooter: include page header/footer when present.includeImageBase64: embed extracted image bytes as base64 in the response.document_annotation_format: JSON schema for whole-document structured extraction.bbox_annotation_format: JSON schema for extracted image / bbox annotations.confidence_scores_granularity: 'page' or 'word'.
Returns pages[].markdown plus optional pages[].hyperlinks, header, footer,
images bounding boxes, annotations, confidence scores, and dimensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document | Yes | ||
| model | No | OCR model. Default: mistral-ocr-latest. | |
| pages | No | ||
| tableFormat | No | ||
| extractHeader | No | ||
| extractFooter | No | ||
| includeImageBase64 | No | ||
| imageLimit | No | ||
| imageMinSize | No | ||
| bbox_annotation_format | No | ||
| document_annotation_format | No | ||
| document_annotation_prompt | No | ||
| confidence_scores_granularity | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | Yes | ||
| model | Yes | ||
| pages_count | Yes | ||
| document_annotation | No | ||
| annotations | No | ||
| usage | No |