Hi Team,
I’m running into an error when trying to analyze an image via “Generate Content.”
The error returned is:
Error: data/messages must be array
What I’m doing
I’m passing an image URL obtained from my workflow as {{workflow.user_photo_url}}.
I expect the model to read the image from that URL and return an analysis.
Current request (simplified)
{
"model": "gpt-4o-mini",
"messages": {
"role": "user",
"content": [
{ "type": "text", "text": "Please analyze this image." },
{ "type": "image_url", "image_url": { "url": "{{workflow.user_photo_url}}" } }
]
}
}
Error
data/messages must be array
Suspected cause
It looks like the API expects messages to be an array of message objects (not a single object). Also, for image inputs, the content itself must be an array containing both text and the image_url part.
Minimal working example I believe should be accepted
Chat Completions format:
{
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Please analyze this image." },
{ "type": "image_url", "image_url": { "url": "{{workflow.user_photo_url}}" } }
]
}
]
}
If I should be using the Responses API instead, could you confirm the correct equivalent payload? (e.g., the proper input schema with an array of content parts for text + image).
Additional details
Headers: Content-Type: application/json, Authorization: Bearer
The URL resolves to a publicly accessible image (no auth); file type is a standard PNG/JPEG.
The templated variable {{workflow.user_photo_url}} expands to a full https URL (I’ve verified it’s not empty).
https://cdn.discordapp.com/attachments/1422377361046896701/1422377361315205120/image.png?ex=68dc73a5&is=68db2225&hm=88c9a4180b177673903cd65d31223c96183a49f6d4fde2e7ae5dcbe68122fe72&
https://cdn.discordapp.com/attachments/1422377361046896701/1422377361625845790/image.png?ex=68dc73a5&is=68db2225&hm=ef90ad65343c0d021d41285df364b5b1834bed039211c5731dd562170675c89d&
https://cdn.discordapp.com/attachments/1422377361046896701/1422377361885761557/SPOILER_image.png?ex=68dc73a5&is=68db2225&hm=4a89f2939fbf751bdae91cab58da39d46846d1f7d7988e1a42f22400082172e3&