Links in this article might open content in the new Microsoft Foundry documentation instead of the Foundry (classic) documentation you’re viewing now.
Prerequisites
To use image models in your application, you need:- An Azure subscription with a valid payment method. Free or trial Azure subscriptions won’t work. If you don’t have an Azure subscription, create a paid Azure account to begin.
- A Microsoft Foundry project.
-
An image model deployment on Foundry.
- This article uses a Mistral OCR model deployment.
- The endpoint URL and key.
Use image-to-text model
-
Authenticate using an API key. First, deploy the model to generate the endpoint URL and an API key to authenticate against the service. In this example, the endpoint and key are strings holding the endpoint URL and the API key. The API endpoint URL and API key can be found on the Deployments + Endpoint page once the model is deployed.
If you’re using Bash:
If you’re in PowerShell:If you’re using Windows command prompt:
-
Run a basic code sample. Different image models accept different data formats. In this example, Mistral OCR 25.03 supports only base64 encoded data; document url or image url isn’t supported. Paste the following code into a shell.
More code samples for Mistral OCR 25.03
To process PDF files:Model-specific parameters
Some image-to-text models only support specific data formats. Mistral OCR 25.03, for example, requiresbase64 encoded image data for their document_url parameter. The following table lists the supported and unsupported data formats for image models in the model catalog.