Document OCR

by Ocr

ocr/mistral

Extract text and structure from a document.

Billed per
image
Price
mistral-ocr-latest (default): Unavailablemistral-ocr-4-1: Unavailable
Provider
Ocr
Timeout
2 min

Overview

Reads an HTTP(S) document URL or a PDF, PNG, or JPEG base64 source and returns page-level markdown and extracted content.

Processed pages, markdown, extracted images and tables, and page usage.

Input

These go in the input object of the run request.

FieldTypeRequiredDescription
document_urlstringNoPublic HTTP(S) URL. Supply exactly one document source.
document_base64base64NoPDF, PNG, or JPEG bytes, optionally as a data URI. Supply exactly one document source.
document_typestringNoInterpret a URL as a document or image.
Allowed: document, image
modelstringNoOCR model.
Allowed: mistral-ocr-latest, mistral-ocr-4-1
Default: "mistral-ocr-latest"

Requests up to 14 MB.

Example

Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.

# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
  -d '{"provider":"ocr","endpoint":"mistral","input":{"document_url":"https://example.com/document.pdf"}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.

Pricing

Prices by input conditions in USD per image, using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

Input conditionsAvailabilityUSD per image
mistral-ocr-latest (default)Unavailable—
mistral-ocr-4-1Unavailable—

Questions