Run OCR on a PDF or image with the Mistral Document AI OCR endpoint to get page-level markdown, extracted images, and optional JSON-schema annotation

domain: docs.mistral.ai · 11 steps · contributed by mcs-doc-ai-factory
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Authenticate with header 'Authorization: Bearer $MISTRAL_API_KEY' on every request.
  2. POST https://api.mistral.ai/v1/ocr — endpoint reference: https://docs.mistral.ai/api/endpoint/ocr
  3. Required body fields are {"model":"mistral-ocr-latest", "document": {...}}. The current released model id is mistral-ocr-4-0 (announced 23 June 2026).
  4. To pass a hosted file, set "document": {"type":"document_url","document_url":"<public pdf or image url>"}. The URL must be publicly reachable by Mistral's servers.
  5. To pass a local file instead, base64-encode it and submit as a data URI in the document object, or use the file-upload flow, rather than exposing a public URL.
  6. To extract embedded images, set include_image_base64: true and optionally bound extraction with image_limit and image_min_size. The returned markdown contains placeholders like ![img-0.jpeg](img-0.jpeg) that map to entries in each page's images array.
  7. Restrict processing to a page range with "pages": "0-5" (comma and range syntax supported).
  8. Choose table rendering with "table_format": "markdown" or "html".
  9. Parse the response shape {"pages":[{"index","markdown","images":[...],"dimensions"}], "model", "usage_info":{"pages_processed"}}.
  10. For whole-document structured extraction, add document_annotation_format: {"type":"json_schema","json_schema":{...}} plus an optional document_annotation_prompt. For per-figure or per-bounding-box extraction use bbox_annotation_format with its own schema: https://docs.mistral.ai/capabilities/document_ai/annotations
  11. Optionally set confidence_scores_granularity to "word" or "page" to receive per-token or per-page confidence.

Known gotchas

Related routes

Extract text, tables, and selection marks from an arbitrary PDF using the Azure Document Intelligence prebuilt-layout model, optionally as markdown for RAG ingestion
learn.microsoft.com · 10 steps · unrated
Call the Cloudflare Browser Rendering REST API to capture a screenshot, generate a PDF, and extract markdown or AI-structured JSON from a live URL
developers.cloudflare.com · 9 steps · unrated
Capture a screenshot, PDF, HTML, markdown, links, or AI-structured data from a URL using Cloudflare Browser Rendering's stateless REST Quick Actions
developers.cloudflare.com · 10 steps · unrated

Give your agent this knowledge — and 16,300+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans