OCRRouter

OCR için barındırılan uzak MCP: PDF'leri/görselleri tablolar veya JSON içeren Markdown'a dönüştürür. Ücretsiz Jina ve DeepSeek-OCR modelleri (ayda 50 bin sayfa) ve otomatik yönlendirmeyle Mistral, Gemini, GPT, Textract ve daha fazlası.

Barındırılan MCP Sunucusu

npx add-mcp 'https://api.ocrrouter.ai/v1/mcp'

Claude Code, Codex, Cursor ve daha fazlasına kurulur

Dokümantasyon

Quickstart

Create an API key, then send a file. New accounts start with 50 free credits.

curl https://api.ocrrouter.ai/v1/ocr \
  -H "Authorization: Bearer $OCRROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "file_url": "https://example.com/invoice.pdf",
    "format": "markdown"
  }'

Request

POST https://api.ocrrouter.ai/v1/ocr with a JSON body and an Authorization: Bearer header.

modelstringA model ID such as mistral/mistral-ocr, or auto.
file_urlstringPublic URL of a PDF, image (PNG, JPG, WebP, GIF, HEIC, TIFF, BMP) or Office file (DOCX, PPTX, XLSX, ODT). Use one of file_url, file_base64 or file_id.
file_base64stringThe file as base64, up to 10 MB.
file_idstringID returned by POST /v1/files, for larger files.
formatstringmarkdown (default), json, text, html, csv, docx or xlsx.
pagesstringPage range, for example 1-5,8. Defaults to all pages. Office files and multi-page TIFFs are counted by the pages of their PDF.
fallbacksstring[]Model IDs to try, in order, if the first model fails.
routestringWith model auto: quality (default), cheapest or fastest.
filenamestringOptional name shown in your activity log.

Other endpoints:

  • GET /v1/models lists every model, its price and whether it is available. No key needed.
  • POST /v1/files takes a multipart upload with a file field and returns a file_id that works for 24 hours.
  • GET /v1/requests/:id returns an earlier result. Add ?format= with any output format to get it in another one.
  • GET /v1/credits returns your balance and this key's usage.
  • POST /v1/keys/temporary returns a temporary key with 50 credits. No sign-up, one per day.

Output formats

markdown

The whole document as Markdown. Tables are GitHub-flavoured tables, formulas are wrapped in $...$, and pages are separated by <!-- page:N -->.

json

The same structure from every model: pages, each with typed blocks. Block types are heading, paragraph, list, table, formula, image, header and footer. bbox, confidence and page size are null when the model does not provide them, which is the case for the models live today.

{"id": "req_8f2c1a41d0b3c7e9a2","model": "mistral/mistral-ocr","format": "json","attempts": [{ "model": "mistral/mistral-ocr", "ok": true, "ms": 1180 }],"pages": [{"index": 1,"width": null,"height": null,"blocks": [{"type": "heading","level": 1,"text": "Invoice INV-2041","bbox": null,"confidence": null},{"type": "paragraph","text": "Acme Supply Co.\n14 Harbour Street, Sydney NSW 2…","bbox": null,"confidence": null},{"type": "table","rows": [["Item", "Qty", "Unit price", "Amount"],["A4 paper, 5 reams", "4", "$24.00", "$96.00"]],"markdown": "| Item | Qty | Unit price | Amount |\n|---|---|-…","bbox": null,"confidence": null}]}],"usage": {"pages": 1,"credits": 25,"latency_ms": 1180,"cached": false}}

text, html, csv, docx, xlsx

The Markdown response plus an output object holding a file: format, filename, mime_type, encoding and data. text, html and csv are UTF-8 strings (encoding: "utf8"); docx and xlsx are base64 (encoding: "base64"). csv and xlsx hold the tables (one sheet per table), or the text lines when there are none. txt is accepted as another name for text.

{"id": "req_8f2c1a41d0b3c7e9a2","model": "mistral/mistral-ocr","format": "docx","attempts": [{ "model": "mistral/mistral-ocr", "ok": true, "ms": 1180 }],"markdown": "<!-- page:1 -->\n# Invoice INV-2041\n…","pages": [{ "index": 1, "markdown": "# Invoice INV-2041\n…" }],"output": {"format": "docx","filename": "invoice.docx","mime_type": "application/vnd.openxmlformats-officedocument.w…","encoding": "base64","data": "UEsDBBQAAAAIA…"},"usage": {"pages": 1,"credits": 25,"latency_ms": 1180,"cached": false}}

Routing and fallbacks

Set model to auto and we choose a model for each document. Use route to say what matters: cheapest, fastest or quality.

Add fallbacks to keep working through outages. If the first model errors or is rate-limited, the next one runs. The response tells you which model answered, and you pay only for that one.

{"model": "mistral/mistral-ocr","fallbacks": ["google/gemini-flash", "tesseract/tesseract"],"file_url": "https://example.com/report.pdf"}

Credits

Each model has a price in credits per page. $1 buys 1,000 credits and they do not expire. Every response includes usage.credits.

  • Failed and empty results are free.
  • Sending the same file to the same model again is served from cache for free.
  • Each API key can have its own credit limit.

Errors

400The request is malformed or the file type is not supported.

401The API key is missing or revoked.

402Not enough credits, or the key hit its credit limit.

413The file is larger than the limit for this model.

429Too many requests. Retry after the time in the Retry-After header.

502Every model in the fallback chain failed. You are not charged.

503The model you asked for is not connected yet.

Agents, MCP and CLI

OCRRouter runs a remote MCP server at https://api.ocrrouter.ai/v1/mcp with two tools: ocr (a PDF or image URL or base64 to Markdown or JSON) and list_models. Send your API key in the Authorization header. Tesseract is free, up to 50,000 pages a month per account; other models use credits or a plan. Agents without an account can get a temporary key with 50 credits from POST /v1/keys/temporary, one per day.

# Remote MCP server for Claude Code
claude mcp add --transport http ocrrouter https://api.ocrrouter.ai/v1/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

# Cursor, Windsurf and other clients (mcp.json)
{
  "mcpServers": {
    "ocrrouter": {
      "url": "https://api.ocrrouter.ai/v1/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}