GPT 4o API - Using Assistant with ID to view Images

Hello, I am trying to use the assistant in API to view some images but the documentation doesn’t seem to cover everything.

GPT4o is able to take base64 encoded images as input using post request or creating a client. However, when I try the same with an assistant, it doesn’t work. Using client.beta.threads.messages.create and passing assistant_id in threads, the same syntax for passing a base64 image stops working. The odd thing is, it is able to view images as url from the web but it is unable to use the same image pointing to the url image syntax which had worked in the other methods.

Here is what I mean by the syntax:

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

Where img is a base64 image.

If someone could provide an example where you call an assistant using its id and pass some images for it to analyze that would be very helpful.

I am also trying to avoid uploading these images because I want the response to be quick and do not need it to save. I am also using an assistant so I can have some knowledge that is kept on the servers for reference.