<!-- BusyBot node reference — https://busybot.net/tools/mistral-ai-ocr/ -->

> Node: Mistral AI OCR (`mistral_ai_ocr`) · Action (binary) · v1
> Category: Utility · Credentials: Mistral AI API (`mistralAiApi`)
> Updated: 2026-08-16

# Mistral AI OCR

> Extract text from PDFs and images using Mistral AI OCR

## Overview

The Mistral AI OCR tool uses the Mistral AI OCR API to extract text from PDF documents and images. It accepts input as binary data (from upstream nodes) or as a URL. The API returns structured page-level results with markdown text, image coordinates, dimensions, and hyperlinks. Supports batch processing for multiple documents in a single efficient API call. Outputs extracted text as JSON with convenience fields (extractedText, pageCount). The original binary data from the input item is forwarded unchanged on the output.

**Category:** Utility  
**Tool Name:** `mistral_ai_ocr`  
**Version:** 1

**Appearance:** Icon: `lucide-ScanLine` | Color: `#FF7000`

## Node Type

**Action (Binary)** — handles file/binary data operations

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **Mistral AI API** credentials.
See the [Credentials Guide](https://busybot.net/credentials/mistral-ai-api/) for setup instructions.

### Resources

| Resource | Value |
|----------|-------|
| Document | `document` |

### Operations

| Operation | Value | Description |
|-----------|-------|-------------|
| Extract Text | `extractText` | Extract text from a document or image using OCR |

### Parameters

#### Document: Extract Text

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Model | `options` | Yes | `mistral-ocr-latest` | The OCR model to use for text extraction. |
| | | | | Options: `mistral-ocr-latest` |
| Document Type | `options` | Yes | `document_url` | The type of document to process. Choose "Document" for PDFs or "Image" for image files. |
| | | | | Options: `document_url` (a PDF document), `image_url` (an image file — JPEG, PNG, etc.) |
| Input Type | `options` | Yes | `binary` | How the document will be provided. When batch mode is enabled, only binary data input is supported. |
| | | | | Options: `binary` (read the document from a binary property on the input item), `url` (provide a URL to the document or image) |
| Input Binary Field | `string` | Yes | `data` | Name of the binary property containing the file to process. Uploaded document files must not exceed 50 MB in size and should be no longer than 1,000 pages. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. _(shown when Input Type is `binary`)_ |
| URL | `string` | Yes | — | URL of the document or image to process. Enter a literal URL — this field does not evaluate `{{ }}` expressions. _(shown when Input Type is `url`)_ |
| Enable Batch Processing | `boolean` | No | `false` | Whether to process multiple documents in a single batch API call. More cost-efficient for processing many documents. Only binary data input is supported in batch mode. |
| Batch Size | `number` | Yes | `50` | Maximum number of documents to process in a single batch file. Between 1 and 2048. _(shown when Enable Batch Processing is `true`)_ |
| Delete Files After Processing | `boolean` | No | `true` | Whether to delete the uploaded files on Mistral Cloud after batch processing completes. _(shown when Enable Batch Processing is `true`)_ |

#### All Operations

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Max Concurrency | `number` | No | `5` | Maximum number of items to process concurrently in single (non-batch) mode. Between 1 and 50. |

## Output Data

The OCR result is **merged onto the input item JSON** — the incoming fields pass through unchanged, and the original binary data is forwarded untouched, so a downstream node can still read the source file. **One output item per input item**; the node never fans out, in either single or batch mode.

Merged onto each item:

| Field | Description |
|-------|-------------|
| `pages` | The page-level results from the API. Each page carries its `markdown` text, plus image coordinates, dimensions and hyperlinks. |
| `extractedText` | Convenience field — every page's `markdown` joined together with a blank line between pages. This is the field most workflows read. |
| `pageCount` | Convenience field — the number of pages in `pages`. |

The remaining fields of the API's OCR response are merged alongside these.

Reference the result downstream by expression, e.g. `{{ $json.extractedText }}` or `{{ $json.pageCount }}`.

## Usage Examples

- Extract text from a PDF document using OCR
- OCR an image to get text content
- Batch process multiple PDF documents for text extraction
- Extract text from a document URL without binary data
- Get page-level markdown from a scanned document

## Example Configuration

Read a PDF from an upstream node's binary output and OCR it:

```json
{
  "type": "mistral_ai_ocr",
  "parameters": {
    "resource": "document",
    "operation": "extractText",
    "model": "mistral-ocr-latest",
    "documentType": "document_url",
    "inputType": "binary",
    "binaryPropertyName": "data",
    "maxConcurrency": 5
  }
}
```

OCR an image that lives at a fixed URL — no upstream file needed:

```json
{
  "type": "mistral_ai_ocr",
  "parameters": {
    "resource": "document",
    "operation": "extractText",
    "model": "mistral-ocr-latest",
    "documentType": "image_url",
    "inputType": "url",
    "url": "https://example.com/image.jpg"
  }
}
```

High-volume PDF processing — batch 20 documents per API job and clean up afterwards:

```json
{
  "type": "mistral_ai_ocr",
  "parameters": {
    "resource": "document",
    "operation": "extractText",
    "model": "mistral-ocr-latest",
    "documentType": "document_url",
    "inputType": "binary",
    "binaryPropertyName": "document",
    "batch": true,
    "batchSize": 20,
    "deleteFiles": true
  }
}
```

Single-document mode against a non-default binary field, with concurrency raised:

```json
{
  "type": "mistral_ai_ocr",
  "parameters": {
    "resource": "document",
    "operation": "extractText",
    "model": "mistral-ocr-latest",
    "documentType": "document_url",
    "inputType": "binary",
    "binaryPropertyName": "attachment",
    "batch": false,
    "maxConcurrency": 10
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Extract text from PDF documents and images using Mistral AI OCR API — supports binary data or URL input with optional batch processing.

### Important Notes

- **Batch Mode Restriction:** When `batch` is `true`, only `inputType: "binary"` is supported
- **File Constraints:** Binary files must not exceed 50 MB and should be no longer than 1,000 pages
- **Cost Efficiency:** Use batch mode for processing multiple documents to reduce API costs
- **Concurrency:** The `maxConcurrency` parameter only applies to non-batch processing modes

### Behavior notes

- **Match Document Type to the file.** `document_url` is for PDFs and `image_url` is for images; picking the wrong one makes the API reject the file even though the binary data is fine.
- **Batch mode waits for the whole job.** The node uploads the documents, starts the batch job and waits for it to finish before emitting any item, so a batch run takes as long as its slowest job. Single mode emits each item as soon as its own request returns.
- **Delete Files After Processing only affects the copies on Mistral Cloud.** The binary data on your workflow items is never touched.
- **Parameters are used literally.** Fill them in on the node rather than trying to compute them per item with `{{ }}` expressions.