curl https://api.portkey.ai/v1/ocr \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral-ocr-latest",
"document": {
"type": "document_url",
"document_url": "https://example.com/document.pdf"
},
"include_image_base64": true
}'{
"pages": [
{
"index": 0,
"markdown": "# Document Title\n\nThis is the extracted text content...",
"images": [
{
"id": "<string>",
"image_base64": "<string>"
}
]
}
],
"model": "mistral-ocr-latest",
"usage_info": {
"pages_processed": 3
}
}OCR
POST
/
ocr
curl https://api.portkey.ai/v1/ocr \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral-ocr-latest",
"document": {
"type": "document_url",
"document_url": "https://example.com/document.pdf"
},
"include_image_base64": true
}'{
"pages": [
{
"index": 0,
"markdown": "# Document Title\n\nThis is the extracted text content...",
"images": [
{
"id": "<string>",
"image_base64": "<string>"
}
]
}
],
"model": "mistral-ocr-latest",
"usage_info": {
"pages_processed": 3
}
}Authorizations
Portkey-Key & Virtual-KeyPortkey-Key & Provider-Auth & Provider-NamePortkey-Key & ConfigPortkey-Key & Provider-Auth & Provider-Name & Custom-Host
Headers
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
Body
application/json
Request body for extracting text from documents using OCR. Supported providers include Mistral AI and Azure AI Foundry.
Response
200 - application/json
OK
Response from the OCR endpoint containing extracted content per page.
Last modified on August 12, 2026
Was this page helpful?

