#Incompatibility between Mistral and OpenAI API for image content

3 messages · Page 1 of 1 (latest)

livid spindle
#

I was trying to use the OpenAI .NET client to call Pixtral with image content, since we'd already successfully used it for text generation.

I found that Mistral expects 'image_url' to be formatted as a string:

{
                "type": "image_url",
                "image_url": f"data:image/jpeg;base64,{base64_image}" 
}

While OpenAI expects it as an object:

{
          "type": "image_url",
          "image_url": {
            "url": f"data:image/jpeg;base64,{base64_image}"
          }
}

Was this intentional for any reason?

I was getting back an HTTP 400, and narrowed it down to the image content. If I removed the image content, the API call succeeded.

It now makes calling Pixtral not compatible with OpenAI clients, I believe?

crystal dome
livid spindle