Skip to main content
POST

Authorizations

x-portkey-api-key
string
header
required
x-portkey-virtual-key
string
header
required

Headers

x-portkey-trace-id
string

An ID you can pass to refer to one or more requests later on. If not provided, Portkey generates a trace ID automatically for each request. Docs

x-portkey-span-id
string

An ID you can pass to refer to a span under a trace.

x-portkey-parent-span-id
string

Link a child span to a parent span

x-portkey-span-name
string

Name for the Span ID

x-portkey-metadata
object

Pass any arbitrary metadata along with your request

Body

application/json

Request body for extracting text from documents using OCR. Supported providers include Mistral AI and Azure AI Foundry.

model
string
required

ID of the model to use for OCR processing. Model availability depends on the provider:

  • Mistral AI: mistral-ocr-latest, mistral-ocr-4-0
  • Azure AI Foundry: mistral-ocr-4-0, mistral-document-ai-2505, mistral-document-ai-2512
Example:

"mistral-ocr-latest"

document
object
required

The document to process. Specify either a URL or base64-encoded content.

include_image_base64
boolean
default:false

Whether to include base64-encoded images of each page in the response.

image_limit
integer

Maximum number of pages to process. If not specified, all pages are processed.

Required range: x >= 1
image_min_size
integer

Minimum size (in pixels) for images to be included in the response.

Required range: x >= 1
pages
integer[]

Specific page numbers to process (0-indexed). If not specified, all pages are processed.

Response

200 - application/json

OK

Response from the OCR endpoint containing extracted content per page.

pages
object[]
required

Array of processed pages with extracted content.

model
string
required

The model used for OCR processing.

Example:

"mistral-ocr-latest"

usage_info
object

Usage information for the request.

Last modified on August 5, 2026