GPT4.5 stopped processing Base64 image?

GenixPRO 71 Reputation points
2025-05-08T11:12:26.8166667+00:00

Hi. What worked fine until a few days ago has stopped working now.

We use GPT4.5 to process Base 64 images. model name: gpt-4.5-preview api_version: 2024-12-01-preview

{

"type": "image_url",

"image_url": {

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

 }

}

This code seemed to work a few days ago and now throws the following error:

Error code: 400 - {'error': {'message': 'Invalid content type. image_url is only supported by certain models.', 'type': 'invalid_request_error', 'param': 'messages.[1].content.[1].type', 'code': None}}

What ay be the issue here?

*Note: Before a suggestion is made to use GPT4.1 -> we've tried and the performance was bad compared to GPT4.5 for our usecase. So have to continue using 4.5 until it expires/retires in 3 months.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,005 questions
{count} votes

1 answer

Sort by: Most helpful
  1. santoshkc 14,515 Reputation points Microsoft External Staff Moderator
    2025-05-08T12:48:36.2866667+00:00

    Hi @GenixPRO,

    The issue you're encountering with GPT-4.5 not accepting Base64-encoded images via the data: URL might be any recent change in the model's API behaviour. While this approach worked earlier, support for directly embedding Base64 images using data:image/... URLs appears to have been deprecated or restricted in the latest API version (2024-12-01-preview). This is why you're now seeing the "Invalid content type" error.

    To resolve this, you'll need to upload the image to an external location such as Azure Blob Storage or any public image host and pass the publicly accessible HTTPS URL instead. If you're using Azure, you can generate a SAS URL for the uploaded image and use that in your request. We understand you prefer to continue using GPT-4.5 for its performance advantages, and this workaround will let you keep leveraging it until it retires.

    Please look into: Vision-enabled chat model concepts.

    I hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful, to help others find this solution as well.

    0 comments No comments

Your answer

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