The latest API model, chatgpt-4o-latest, only allows image recognition using base64?

Request:

{
  "max_tokens": 4095,
  "stream": true,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "what is this?"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://**********/imgs/2024/08/e9112022734f4206.png"
          }
        }
      ]
    }
  ],
  "model": "chatgpt-4o-latest",
  "temperature": 1.0,
  "presence_penalty": 0.0,
  "frequency_penalty": 0.0
}

Response:

{
  "error": {
    "message": "Invalid image URL: 'messages[0].content[1].image_url.url'. Expected a base64-encoded data URL with an image MIME type (e.g. 'data:image/png;base64,aW1nIGJ5dGVzIGhlcmU='), but got a value without the 'data:' prefix.",
    "type": "invalid_request_error",
    "param": "messages[0].content[1].image_url.url",
    "code": "invalid_value"
  }
}

Coudld simply be that the image host has decided to block OpenAI’s servers from pulling back images, this has happened before.

2 Likes

Thank you for your response, but when I use the same image, other OpenAI visual models, such as GPT-4o-2024-08-06, don’t behave this way.

Just a question, for my curiosity: why not just always use b64? :thinking:

as far as I’m concerned, hosting images separately just adds a bunch of unnecessary development overhead, but maybe I’m overlooking something.

(I’m not defending openai silently deprecating an advertised feature if this is the case here, just asking)

1 Like

In my current business scenario, the images aren’t uploaded by users on the fly but are stored on an established hosting platform, and I need to categorize and tag them accordingly.

2 Likes