Using an image as input gpt4 api

It is not. You sent the base64 encoded image as text.

You did something like,

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

But you need to do,

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