Mistral's document OCR - turns PDFs and images into clean per-page markdown with tables, reading order, paragraph-level bounding boxes and block labels. Billed per processed page (9.3 credits/page); the first 10 pages are processed unless `pages` is given.
Test this model instantly in the Console Playground โ no code required
Copy usage instructions for Claude, ChatGPT, or other AI
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "mistral/ocr-4.1",
"input": {
"document": "https://arxiv.org/pdf/2201.04234",
"pages": [
0,
1
]
}
}'| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
document | string | Yes | - | URL of the document - a PDF or an image (JPEG, PNG, WEBP, GIF, BMP, TIFF, HEIF, AVIF). Mistral downloads it directly, so the URL must be publicly reachable. Up to 50MB. |
pages | array | No | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | 0-based page indexes to process (up to 1,000). Defaults to the first 10 pages. Indexes beyond the end of the document are ignored and not billed. Images are always one page. |
table_format | string | No | - | How tables are written inside the page markdown. Omit for Mistral's default (inline markdown tables). markdownhtml |
extract_header | boolean | No | - | Return each page's running header separately in `header` instead of inside the markdown. |
extract_footer | boolean | No | - | Return each page's running footer separately in `footer` instead of inside the markdown. |
include_blocks | boolean | No | - | Return paragraph-level bounding boxes and block labels in `blocks` (on by default upstream). Set false for markdown only. |
There are 3 ways to provide files for the document parameter:
Pass a publicly accessible URL directly. With the Storage API (POST /v1/files/upload-url) the file uploads straight to S3 (50MB per file) and you pass the returned file_url.
{
"model": "mistral/ocr-4.1",
"input": {
"prompt": "your prompt here",
"document": "https://example.com/image.jpg"
}
}Attach files directly to POST /v1/predictions/upload. No separate upload step, but the bytes pass through the API server so the whole request is capped at 10MB.
curl -X POST "https://api.core.today/v1/predictions/upload" \
-H "X-API-Key: cdt_your_api_key" \
-F "model=mistral/ocr-4.1" \
-F 'input={"prompt":"your prompt here"}' \
-F "file:document=@your_file.png"Common parameters used when calling POST /v1/predictions.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model identifier |
input | object | Yes | - | Object containing the model-specific parameters from the table above |
output_folder | string | No | - | Folder path for output files (max 256 chars, '..' not allowed) |
webhook_url | string | No | - | Webhook URL to call on completion |
is_public | boolean | No | false | If true, output files are also available via permanent public URLs |
Returns {pages[], model, usage_info} - each page has markdown, tables, hyperlinks, dimensions and blocks. usage_info.pages_processed is the billed page count.
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "mistral/ocr-4.1",
"input": {
"document": "https://arxiv.org/pdf/2201.04234",
"pages": [
0,
1
]
}
}'An image is one page (about 10 credits).
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "mistral/ocr-4.1",
"input": {
"document": "https://example.com/receipt.png",
"table_format": "html",
"include_blocks": false
}
}'POST /v1/predictions