MistralDocument to textAvailable now

mistral-ocr-4

mistral-ocr-4 is a document to text tool from Mistral that runs in the background and returns structured JSON. Pay as you go from $0.0052 per page, with one API key.

Try itfrom $0.0052 / page

Pricing

$0.0052 per page, or $0.0065 per page with document_annotation_format or bbox_annotation_format. Billed on pages, or the file's page count. The final charge comes from usage.

Limits

Runs
In the background
Returns
json
Longest queue wait
3600s
Run deadline
1800s
Largest inline input
1024 KB
Largest input file
500 MB
Largest output
4768 MB
Outputs per run
16

Input

FieldKindDefaultDescription
document requiredJSON—Document to run OCR on
pagesJSON—Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0.
image_limitnumber (whole)—Max images to extract
table_formatone of
markdown, html
—
extract_footertrue or falsefalseExtract the page footer into the response's `footer` field and remove it from the markdown content
extract_headertrue or falsefalseExtract the page header into the response's `header` field and remove it from the markdown content
image_min_sizenumber (whole)—Minimum height and width of image to extract
include_blockstrue or falsetrueReturn paragraph-level bounding boxes for all content blocks in the response
include_image_base64true or false—Include image URLs in response
bbox_annotation_formatJSON—Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field
document_annotation_formatJSON—Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field
document_annotation_prompttext—Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided.
confidence_scores_granularityone of
word, page, block
—Granularity for confidence scores: 'page' (aggregate only), 'word' (per-word scores), or 'block' (per-block scores). Defaults to None (no confidence scores) to keep response payload small.

Same request in code

curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "mistral",
    "model": "mistral-ocr-4",
    "input": {
      "document": {}
    }
  }'