5ykxbP

zkDGNr

CcJuiO
0J99jC
zMjN8w
1

Ts0JSN

sEHAh+

mT57+Q
2

G3BEIz

XL8QJe

+MJgB2
6WlLBG
3

dqY5Ze

VJmyVu

rlcU3z

E5l2+6

TYVrBU

POST
POST https://www.mistralocr.app/api/ocr/process

z8cnI9

{
  "image": "base64_encoded_image_data",
  "options": {
    "format": "text" # json, text, markdown
  }
}

jwobhd

{
  "imageUrl": "https://img.mistralocr.app/mistral-ocr/...",
  "options": {
    "format": "text" # json, text, markdown
  }
}

ZlCDf+

{
  "success": true,
  "userId": "user_123",
  "inputSource": "base64",
  "extractedText": "Extracted text content...",
  "confidence": 0.95,
  "processingTime": 1.2,
  "creditsUsed": 1
}

P8fBlG

kAjRyc

vo2tSN

BKRygP

x-api-key: mk_your_api_key_here

OTWced

Authorization: Bearer mk_your_api_key_here

FbKfzq

8hQ93K

MCP

CDSrVE:

POST https://www.mistralocr.app/api/mcp

BVGtQf:

GET https://www.mistralocr.app/api/mcp

DTxppa

avEhd/

  • aSZ9oo
  • MLJMF7
  • suK5wD
  • K54DVE

O+PEdA

  • vDyqBO
  • IwqMJ5
  • fqPH6J
  • eksz3z

YBdRIU

🔍 extract_text

z1BB46

Parameters:
- image_source (object, required):
- type: 'base64' | 'url'
- data: base64 string or file URL
- filename: document.pdf, image.jpg, etc. (optional)
- output_format (string, optional): 'text'|'json'|'markdown'

Supported formats: PDF, JPEG, PNG, WebP

omXafQ

hiZA2H:
extract_text My//wE
sxk+se:
extract_text SxQLol
3H/ce8:
PDF documents, JPEG/JPG images, PNG images, WebP images

2PDbS9

Cursor/Claude Desktop

ecgZfW

hRHEl+

kJBDZn: cursor_mcp_config.json

{
  "mcp": {
    "servers": {
      "mistral-ocr": {
        "url": "https://www.mistralocr.app/api/mcp",
        "transport": "http",
        "headers": {
          "x-api-key": "mk_your_api_key_here",
          "Content-Type": "application/json"
        },
        "capabilities": { "tools": true }
      }
    }
  },
  "shortcuts": {
    "ocr": "@mistral-ocr extract_text"
  },
  "workflows": {
    "large_file_ocr": [
      "extract_text with public_url"
    ],
    "small_file_ocr": [
      "extract_text with base64 data"
    ]
  }
}

B066Ev:

FL9gTj: @ocr
Eg//Zl

Zs1gDN

sxkWRg

EblDXQ

QD8JQn: mcp_config.json

{
  "mcp": {
    "servers": {
      "mistral-ocr": {
        "url": "https://www.mistralocr.app/api/mcp",
        "transport": "http",
        "authentication": {
          "type": "api_key",
          "header": "x-api-key",
          "key": "mk_your_api_key_here"
        },
        "capabilities": {
          "tools": true,
          "resources": false,
          "prompts": false
        },
        "metadata": {
          "name": "Mistral OCR",
          "description": "OCR service for PDF and image text extraction",
          "version": "2.0.0"
        }
      }
    }
  },
  "client": {
    "timeout": 30000,
    "retries": 3,
    "transport_fallback": ["http", "sse"]
  }
}

+gXHpw:

// Initialize MCP connection
const response = await fetch('https://www.mistralocr.app/api/mcp', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'mk_your_api_key'
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'initialize',
    params: {
      protocolVersion: '2024-11-05',
      capabilities: { tools: {} }
    }
  })
});

zrmW59:

// Connect to SSE endpoint
const eventSource = new EventSource(
  'https://www.mistralocr.app/api/mcp?' +
  'api_key=mk_your_api_key'
);

eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Received:', data);
};

P8fBlG

PGhfnS:

  • x-api-key: mk_your_api_key cjw6Ai
  • Authorization: Bearer mk_your_api_key cjw6Ai
  • FETCH_MCP_SERVER_API_KEY=mk_your_api_key c0euuz

MTb8vU

7XWbyX

p2VLWo

curl -X POST https://www.mistralocr.app/api/mcp \
  -H "Content-Type: application/json" \
  -H "x-api-key: mk_your_api_key" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list"
  }'

DgDfrP

curl -N -H "Accept: text/event-stream" \
  -H "x-api-key: mk_your_api_key" \
  https://www.mistralocr.app/api/mcp

HFrKsG

0akUTO

zY6PMh

import requests
import base64

# Base64 method
with open('image.jpg', 'rb') as f:
    image_data = base64.b64encode(f.read()).decode()

response = requests.post(
    'https://www.mistralocr.app/api/ocr/process',
    headers={'x-api-key': 'mk_your_api_key'},
    json={'image': image_data}
)

result = response.json()
print(result['extractedText'])

HA2e0Q

# Base64 method
IMAGE_DATA=$(base64 -i image.jpg)
curl -X POST https://www.mistralocr.app/api/ocr/process \
  -H "x-api-key: mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d "{\"image\": \"$IMAGE_DATA\"}"

jOIou1

jHZCJd