Gpt-4-vision code example for Base64 encoded images is missing

A code example for passing base64-encoded image is missing.
The example here: OpenAI Platform still passing an image URL

The current example worked for me. Not sure if it was updated recently, but this is what it is showing now, and worked for me…

    "messages": [
        "role": "user",
        "content": [
            "type": "text",
            "text": "What’s in this image?"
            "type": "image_url",
            "image_url": {
              "url": f"data:image/jpeg;base64,{base64_image}"

Event though type is set to image_url, it seems to be taking the base64 version of the image just fine.

Yes, it works. Either I am hallucinating or the example was fixed. I clearly remember url being “https://” :slight_smile:

1 Like