ReferenceInformation-oriented

Mistral OCR 3 API Reference

Complete reference for endpoints, parameters, response formats, and pricing.

API Endpoints

POST/v1/ocr

Process a single document and return extracted text as markdown.

POST/v1/ocr/batch

Submit multiple documents for batch processing (50% cost savings).

GET/v1/ocr/batch/{batch_id}

Check status and retrieve results of a batch job.

Base URL

https://api.mistral.ai

Request Parameters

POST /v1/ocr

ParameterTypeRequiredDescription
modelstringYesModel ID: mistral-ocr-2512
documentobjectYesDocument object (see below)

Document Object

FieldTypeDescription
typestringDocument type: pdf | image
datastringBase64-encoded document content (mutually exclusive with url)
urlstringPublic URL to document (mutually exclusive with data)

Response Format

{
  "id": "ocr-abc123",
  "object": "ocr.document",
  "created": 1735123456,
  "model": "mistral-ocr-2512",
  "content": "# Document Title\n\nExtracted markdown content...",
  "pages": 5,
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 2847,
    "total_tokens": 2847
  }
}
FieldTypeDescription
idstringUnique request identifier
contentstringExtracted text as markdown (with HTML tables)
pagesintegerNumber of pages processed
usage.total_tokensintegerTokens used for billing

Supported Document Types

PDF Documents

  • - Native PDFs (text embedded)
  • - Scanned PDFs (image-based)
  • - Multi-page documents
  • - Max size: 50MB

Images

  • - PNG, JPEG, WEBP, GIF
  • - TIFF (single page)
  • - Max size: 20MB
  • - Recommended: 300 DPI+

Error Codes

CodeHTTP StatusDescription
invalid_api_key401API key is invalid or missing
rate_limit_exceeded429Too many requests, retry with backoff
document_too_large413Document exceeds size limit
invalid_document400Document is corrupted or invalid format
insufficient_credits402Account has insufficient credits
internal_error500Server error, retry later

Rate Limits

Free Tier

  • - 100 pages/month
  • - 10 requests/minute
  • - 5 concurrent requests

Paid Tier

  • - Unlimited pages
  • - 100 requests/minute
  • - 50 concurrent requests

Rate limit headers: X-RateLimit-Remaining, X-RateLimit-Reset

Pricing

Standard API
$2/1000 pages

Real-time processing, immediate results

Batch API
$1/1000 pages

Async processing, 50% cost savings

Billing Notes

  • - Minimum charge: 1 page per document
  • - Failed requests are not charged
  • - Usage tracked via usage.total_tokens in response

Python SDK

pip install mistralai

Client Initialization

from mistralai import Mistralimport os# Using environment variable (recommended)client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])# Or pass directlyclient = Mistral(api_key="your-api-key")

SDK Methods

MethodDescription
client.ocr.process()Process a single document
client.ocr.batch_process()Submit a batch job
client.ocr.get_batch()Get batch job status/results

Model Information

Model ID:mistral-ocr-2512
Release Date:December 2025
Output Format:Markdown + HTML tables
Context Window:Unlimited (document-based)