Unable to send images to gpt-4-turbo or gpt-4o

Hi all.

I have a set of Shortcuts (for Apple’s shortcuts app) that I’m having trouble with when using either gpt-4-turbo or gpt-4o.

I receive the following error from the API:

Error: {"param":"messages.[1].content.[0].type","message":"Invalid content type. image_url is only supported by certain models.","code":null,"type":"invalid_request_error"}

Here’s the json object that I’m sending, with my prompts and images removed. Sorry for the ugly formatting. I’m copying and pasting this straight from shortcuts.

{"temperature":0.5,"messages":[{"content":"prompt","role":"system"},{"content":[{"type":"image_url","image_url":{"url":"data:image\/jpeg;base64,base64string"}},{"type":"text","text":""}],"role":"user"}],"model":"gpt-4o","max_tokens":1500}

Am I doing something wrong here? Prior to today, the shortcut was calling the gpt-4-vision-preview model, which works.

Thanks!

2 Likes

Yup, I can confirm. I am getting the same error.

Edit
My Bad, It actually works. There was a syntax error in my code.

out of curiosity, what was wrong with your code and how did you fix it? that might help me troubleshoot my issue.

1 Like