How to Handle Blank Images with OpenAI Responses?

Hi, I’m using the OpenAI Responses API.

My problem is that I can’t make a call to the API with an empty image input. I need to fill it with something.

This forces me to use 3 APIs: one for text only, another for one image, and another for two images.

How can I make a single call instead of three?

I guess you probably get a list of image?
You could use

...
"content":[<image_json>]
...

And in image json field use list of image:format as text. In the format as text, format the json you need that seem to be

{"type":"input_image","image_url":This image's url:format as json-safe}

Use comma as delimiter. This will also allow you to have a dynamic number of image instead of a specific number defined in API connector.

1 Like

Thanks, I think this may work