Find images via Responses
The Responses API provides two built-in image search tools: text-to-image search finds images matching a text description, and image-to-image search finds visually similar images from an input image. Both tools return a JSON array of results and a model-generated analysis.
These tools are only available through the Responses API.
Search the internet for images that match a text description, then let the model describe and reason about them. Pass
Sample output:
The response
Text-to-image search incurs two types of charges:
Find visually similar images on the internet from an input image, then let the model analyze the results. Pass
Replace
Sample output:
The response
Image-to-image search incurs two types of charges:
Both image search tools support the same set of models.
Image search can take several seconds. Enable streaming to receive results incrementally by setting
See Image limits for supported formats and size constraints, and File input methods for how to pass images.
The total token count for all images and text must stay within the model's maximum input length. The model searches one image at a time but can invoke the tool multiple times in a single response to cover several images.
The model determines the number of results per search. The count is not fixed, but the maximum is 100 images.
Text-to-image search
Search the internet for images that match a text description, then let the model describe and reason about them. Pass {"type": "web_search_image"} in the tools parameter -- the model decides when to search based on the input.
Example
Response format
The response output array contains two item types:
| Item type | Description |
|---|---|
web_search_image_call | The raw search results as a JSON array. Each object includes index, title, and url. |
message | The model's analysis and recommendations based on the search results. |
Billing
Text-to-image search incurs two types of charges:
| Charge type | Details |
|---|---|
| Model call fees | Image search results are added to the prompt, which increases the input token count. Standard model rates apply. See Pricing for details. |
| Tool calling fees | $8 per 1,000 calls. |
Image-to-image search
Find visually similar images on the internet from an input image, then let the model analyze the results. Pass {"type": "image_search"} in the tools parameter and provide the image using the input_image content type. Optionally, include an input_text message to provide additional search context.
Example
Replace image_url in the example code with a publicly accessible image URL (the OpenAI SDK does not support local file paths).
Response format
The response output array contains two item types:
| Item type | Description |
|---|---|
image_search_call | The tool call result containing a JSON array of matched images. Each object includes index, title, and url. |
message | The model's analysis of the search results, accessible through response.output_text. |
Billing
Image-to-image search incurs two types of charges:
| Charge type | Details |
|---|---|
| Model input tokens | Search results are appended to the prompt, which increases input token count. Billed at the model's standard rate. See Pricing for details. |
| Tool call fee | $8 per 1,000 calls. |
Supported models
Both image search tools support the same set of models.
| Model family | Model IDs |
|---|---|
| Qwen-Plus | qwen3.6-plus, qwen3.5-plus, qwen3.5-plus-2026-02-15 |
| Qwen-Flash | qwen3.5-flash, qwen3.5-flash-2026-02-23 |
| Open source Qwen | qwen3.5-397b-a17b, qwen3.5-122b-a10b, qwen3.5-27b, qwen3.5-35b-a3b |
Streaming
For general streaming concepts (SSE protocol, how to enable streaming, billing, and token usage), see Streaming output. This section covers only the streaming behavior specific to image search.
stream=True (Python) or stream: true (Node.js/curl). The response emits events in the following order:
| Event type | Trigger | Action |
|---|---|---|
response.output_item.added | Tool call starts | Display a loading indicator. |
response.output_item.done | Tool call completes | Parse event.item.output as JSON to get the image list. |
response.content_part.added | Model starts responding | Prepare to render streamed text. |
response.output_text.delta | Model sends a text chunk | Append event.delta to the output. |
response.completed | Full response ready | Read final usage statistics. |
FAQs
What image formats and input methods are supported?
See Image limits for supported formats and size constraints, and File input methods for how to pass images.
The OpenAI SDK does not support local file path input.
How many images can I pass as input?
The total token count for all images and text must stay within the model's maximum input length. The model searches one image at a time but can invoke the tool multiple times in a single response to cover several images.
The model determines the number of images to search.