ContextOCR API documentation
Upload a PDF, image, or EML file and get JSON back with Mistral OCR 4-powered output in the markdown field plus usage details. ContextOCR is independent from Mistral AI and adds page boundaries, email body and attachments, visual context, plus QR/barcode types and decoded values.
Endpoint
POST https://api.contextocr.dev/v1/ocr
Auth
Authorization: Bearer ak_... or X-API-Key
Engine
Powered by Mistral OCR 4
Inputs
PDF, EML, JPG, PNG, GIF, BMP, TIFF, WebP
Speed
Most requests return in 2-4 seconds
Billing
1 credit per processed page
Upload a file
Use multipart uploads for normal file streams. Use JSON only when the file is already Base64 in your system.
markdown
The API returns JSON. Read the markdown field from that JSON; its value is already the final OCR output.
JSON response shape
A successful request returns the markdown field, request_id, and usage metadata.
Supported files and limits
These are the current upload, rate, and processing limits.
Headers and body formats
Mostly standard file upload mechanics. X-Request-ID is useful for tracing but is not an idempotency key.
Error handling
Error responses use a stable envelope. Retry 429 after Retry-After. Retry 5xx with backoff. Do not retry 400/401/402/403 without changing the request, key, or balance.
Changelog
Documentation version history for this API reference.