Share via

Issue with Azure Mistral OCR Deployment – Always Returning null

Francisco dos Santos 40 Reputation points
2025-04-23T02:51:44.2366667+00:00

I’ve successfully deployed the Mistral OCR model via Azure AI Studio:

Deployment Name: mistral-ocr-2503-admjg

Model: mistral-ocr-2503

Endpoint: https://mistral-ocr-2503-admjg.eastus2.models.ai.azure.com/v1/ocr

Status: Succeeded

I’m sending valid PDF documents encoded in Base64 to the /v1/ocr endpoint using the image_url field, as shown in the documentation. The request is accepted with a 200 OK response, but the response body is always null, even for clean PDFs containing machine-readable text.

I’ve tested the same documents with the public Mistral API and received valid OCR results, so I suspect the issue is with the Azure-hosted deployment.

Could you please verify whether the OCR model is fully operational in my deployment? Or advise if additional configuration is needed to enable document processing?

Thanks in advance for your help.

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform


Answer accepted by question author

Arthur-Olivier Fortin 145 Reputation points
2025-05-30T12:46:08.99+00:00

What worked for me :

{
	"model": "mistral-ocr-2503-deployment",
 	"document": 
	{    
		"document_url": "data:image/jpeg;base64,{your_base_64_image_data}",
	    "type": "image_url"  
	},   
	"include_image_base64": true
}

for pdfs you need to change the type param for "document_url"

The documentation should be updated, it is quite misleading.

Was this answer helpful?


4 additional answers

Sort by: Most helpful
  1. Daniel Martins Micoski Luz 5 Reputation points
    2025-08-14T22:14:13.1366667+00:00

    I am having the same issue. Some pdfs work like a charm others don´t. It is not size, because I could parse large ones, and it´s not image related issue because I couldn´t parse pdfs without images.

    My code is exactly the notebook provided in the example:

    https://github.com/azure-ai-foundry/foundry-samples/blob/main/samples/mistral/python/mistral-ocr-with-vlm.ipynb

    But I keep getting None in the parsed_doc output.

    My solution was to implement a fallback in my solution to send to another endpoint

    Was this answer helpful?

    1 person found this answer helpful.

  2. Bryant Poston 5 Reputation points
    2025-10-28T12:59:32.43+00:00

    Is anyone's output showing that mistral-ocr is being force to 2505 even though the script is pointing at 2503? that is what is happening to us with null results.

    Was this answer helpful?

    0 comments No comments

  3. GROSJEAN Guillaume 0 Reputation points
    2025-09-09T12:10:00.2433333+00:00

    Experiencing the same issue and accepted answer does not work.

    Getting a 200 status with a "null" body makes it especially difficult to understand what's happening under the hood.

    My deployment is in Sweden Central.

    Was this answer helpful?

    0 comments No comments

  4. Mallo, Raul 0 Reputation points
    2025-08-25T15:07:00.6066667+00:00

    I am having a very similar issue, but the problem is that the same PDFs do sometimes work sometimes fail, without any apparent reason or additional error message.

    The status code is always 200, but sometimes the response.json() method returns the properly analyzed contents, sometimes it returns an empty json (for the exactly same PDF).

    Has anyone had the same issue and properly fixed it?

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.