A developer wants to send an image alongside a text question to a model through OpenAI's Responses API. According to OpenAI's current documentation, how is the image included in the request?
- the request's `input` array includes a content item with `type` set to `input_image`, whose `image_url` field can be either a fully qualified URL pointing to an image or a base64-encoded data URL, placed alongside a separate `input_text` item carrying the text portion of the same message
- images can only be referenced by a fully qualified URL; base64-encoded image data placed directly in the request body is rejected by the endpoint
- images must be attached as raw binary data outside the JSON request body, since the `input` array can only ever contain plain text strings
- images are supplied through the `messages` array using a content type of `image_url` only, with no `input_image` type and no base64 option available
Why A? And why not the others?
Correct answer: A. the request's `input` array includes a content item with `type` set to `input_image`, whose `image_url` field can be either a fully qualified URL pointing to an image or a base64-encoded data URL, placed alongside a separate `input_text` item carrying the text portion of the same message
OpenAI's current documentation for the Responses API shows a content item of type `input_image` inside the `input` array's message content, alongside an `input_text` item for the accompanying question, and the `image_url` field on that item accepts either a plain URL pointing to a hosted image or a base64-encoded data URL, giving developers a choice depending on whether the image is already hosted somewhere accessible. Restricting the field to URLs only is wrong because the documented base64 data-URL form is explicitly supported as an alternative. Claiming images can only be sent as raw binary data outside the JSON body is wrong because the documented mechanism keeps the image reference inside the JSON `input` array like any other content item. Describing the content type as `image_url` inside a `messages` array describes an older, different API shape and gets both the array name and the content type's `type` string wrong for the API actually being asked about.
Source: OpenAI, Images and vision guide, https://developers.openai.com/api/docs/guides/images-vision