[Integrations](https://spiral.ai/integrations) › [Codex](https://spiral.ai/integrations/codex) › [Mistral OCR 4.1](https://spiral.ai/integrations/codex/mistral-ocr-4-1)

# How to Use Mistral OCR 4.1 in Codex

Extract text, tables, and images from PDFs and images, with Markdown content and paragraph bounding boxes. Use it to turn public reports, research papers, or scanned documents into searchable text with locations you can check against the page.

|  |  |
| --- | --- |
| Model | Mistral OCR 4.1 |
| Available through | Mistral |
| Category | Data |
| Price | $0.0052 per page ($0.0065 with document or bounding-box annotations). |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Mistral OCR 4.1 in Codex

- Use Mistral document text extraction on https://www.berkshirehathaway.com/letters/2024ltr.pdf and add the extracted Markdown to this project's document search fixtures.
- Use Mistral document text extraction on https://arxiv.org/pdf/1706.03762 and build a table review screen that shows extracted cells beside their source page.
- Use Mistral document text extraction on Berkshire Hathaway's 2024 shareholder letter at https://www.berkshirehathaway.com/letters/2024ltr.pdf and add clickable paragraph highlights to our PDF viewer.
- Use Mistral document text extraction on https://arxiv.org/pdf/1706.03762 and write a document importer that preserves headings, equations, and page references from the returned content.
- Use Mistral document text extraction on https://arxiv.org/pdf/1706.03762 and add a figure browser to this project using the extracted images and their page locations.

## How to set up Mistral OCR 4.1 in Codex

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the hosted server**

```bash
codex mcp add spiral --url https://api.spiral.ai/mcp
```

2. **Sign in**: Codex opens the browser: sign in to Spiral and click Authorize. No API key. `codex mcp list` then shows Spiral.

```bash
codex mcp login spiral
```

### Use the Spiral skill

1. **Send Codex this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Mistral OCR 4.1**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "mistral",
    "model": "mistral-ocr-4-1",
    "input": {
      "document": {
        "document_url": "<document_url>"
      }
    }
  }'
```

Then paste one of the prompts above: Codex finds Mistral OCR 4.1 on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/codex

## Mistral OCR 4.1 tools and prices

- [Mistral OCR 4.1](https://spiral.ai/tools/mistral/mistral-ocr-4-1) (Mistral): $0.0052 per page ($0.0065 with document or bounding-box annotations).

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| pages |  | — | Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0. |
| image_limit |  | — | Max images to extract |
| table_format | markdown, html | — |  |
| extract_footer |  | false | Extract the page footer into the response's `footer` field and remove it from the markdown content |
| extract_header |  | false | Extract the page header into the response's `header` field and remove it from the markdown content |
| image_min_size |  | — | Minimum height and width of image to extract |

## What can you do with Mistral OCR 4.1 in Codex?

Build a searchable report viewer with extracted text linked to its position on each PDF page. Mistral's paragraph bounding boxes and structural labels give the project source regions to display beside search results.

### Search public annual reports

Convert annual report PDFs into searchable text, keeping page locations beside passages about operating results and business risks.

### Extract research tables

Pull tables from research papers into a review worksheet, then compare the extracted cells with the original pages before analysis.

### Build a document viewer with source highlights

Use paragraph bounding boxes to highlight the source region when a reader selects extracted text.

### Compare editions of public reports

Extract each edition of a company report and compare passages or tables to identify changes for an analyst to review.

### Prepare public documents for retrieval

Turn PDF collections into Markdown passages with document and page references for a search or question-answering system.

### Create a figure review queue

Collect extracted figures from public research papers and keep them beside their source pages for captioning or editorial review.

### Structure public procurement documents

Extract document titles, submission deadlines, and requirements from public tender PDFs into a consistent review record.

## Overview

- [Mistral](https://spiral.ai/providers/mistral)
- [All Codex guides](https://spiral.ai/integrations/codex)

## Mistral OCR 4.1 in other agents

- [Amp](https://spiral.ai/integrations/amp/mistral-ocr-4-1)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/mistral-ocr-4-1)
- [Claude](https://spiral.ai/integrations/claude-desktop/mistral-ocr-4-1)
- [Claude Code](https://spiral.ai/integrations/claude-code/mistral-ocr-4-1)
- [Cline](https://spiral.ai/integrations/cline/mistral-ocr-4-1)
- [Cursor](https://spiral.ai/integrations/cursor/mistral-ocr-4-1)
- [Devin](https://spiral.ai/integrations/devin/mistral-ocr-4-1)
- [dots](https://spiral.ai/integrations/dots/mistral-ocr-4-1)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/mistral-ocr-4-1)
- [Gemini](https://spiral.ai/integrations/gemini/mistral-ocr-4-1)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/mistral-ocr-4-1)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/mistral-ocr-4-1)
- [goose](https://spiral.ai/integrations/goose/mistral-ocr-4-1)
- [Grok](https://spiral.ai/integrations/grok/mistral-ocr-4-1)
- [Grok Build](https://spiral.ai/integrations/grok-build/mistral-ocr-4-1)
- [Hermes](https://spiral.ai/integrations/hermes/mistral-ocr-4-1)
- [Instinct](https://spiral.ai/integrations/instinct/mistral-ocr-4-1)
- [Manus](https://spiral.ai/integrations/manus/mistral-ocr-4-1)
- [Muse](https://spiral.ai/integrations/muse/mistral-ocr-4-1)
- [Muse Code](https://spiral.ai/integrations/muse-code/mistral-ocr-4-1)
- [n8n](https://spiral.ai/integrations/n8n/mistral-ocr-4-1)
- [Notion](https://spiral.ai/integrations/notion/mistral-ocr-4-1)
- [OpenClaw](https://spiral.ai/integrations/openclaw/mistral-ocr-4-1)
- [opencode](https://spiral.ai/integrations/opencode/mistral-ocr-4-1)
- [Perplexity](https://spiral.ai/integrations/perplexity/mistral-ocr-4-1)
- [Raycast](https://spiral.ai/integrations/raycast/mistral-ocr-4-1)
- [VS Code](https://spiral.ai/integrations/vscode/mistral-ocr-4-1)
- [Windsurf](https://spiral.ai/integrations/windsurf/mistral-ocr-4-1)
- [Zapier](https://spiral.ai/integrations/zapier/mistral-ocr-4-1)

## More Codex guides

- [GitHub user repositories](https://spiral.ai/integrations/codex/github-user-repositories)
- [Mistral OCR document extraction](https://spiral.ai/integrations/codex/mistral-ocr-document-extraction)
- [GitHub user pull requests](https://spiral.ai/integrations/codex/github-user-pull-requests)
- [Mistral document OCR](https://spiral.ai/integrations/codex/mistral-document-ocr)
- [GitHub user profile](https://spiral.ai/integrations/codex/github-user-profile)
- [Mistral document text and table extraction](https://spiral.ai/integrations/codex/mistral-document-text-and-table-extraction)

## Questions about Mistral OCR 4.1 in Codex

**Can Codex use Mistral OCR 4.1?**

Yes. Add Spiral to Codex as an MCP server, and Codex can find and run Mistral OCR 4.1 like any built-in tool.

**How much does Mistral OCR 4.1 cost in Codex?**

$0.0052 per page ($0.0065 with document or bounding-box annotations). You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Codex plan is separate.

**Do I need a Mistral account to use Mistral OCR 4.1 in Codex?**

No. Spiral runs Mistral OCR 4.1 on its own Mistral account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Mistral OCR 4.1 in Codex?**

About two minutes: add the hosted server, then sign in.

**Does Codex wait while Mistral OCR 4.1 runs?**

Mistral OCR 4.1 runs in the background. Codex starts the run, checks on it and gives you the json when it's ready.

**Does Mistral OCR retrieve the latest version of a report?**

It extracts content from the PDF or image supplied for processing. The document determines the reporting period and freshness; processing an older report does not update its contents.

**How large a document can Mistral OCR process?**

Mistral's chunking cookbook lists typical limits of approximately 50 MB and 1,000 pages. For larger documents, split the PDF into smaller sections before extraction.

**What language coverage does Mistral document?**

Mistral documents OCR 4 support for 170 languages across 10 language groups. That coverage statement does not promise identical recognition accuracy across languages.

**Can extracted text be located on the original page?**

OCR 4.1 supports paragraph bounding boxes and structural block labels. Those locations let a document viewer highlight the source region beside the extracted text.

**Does document annotation examine every extracted figure?**

Mistral's documented annotation workflow sends the extracted Markdown and the first eight extracted image bounding boxes to a vision model. A document annotation therefore does not include every image in a report containing more than eight extracted images.

