The search by image tool enables the model to search the Internet for visually similar images based on an input image. The model can then analyze the search results and make inferences. This feature is useful for scenarios such as finding similar products or tracing the origin of visual content.
How to use
You can call the search by image feature through the Responses API. Add the image_search tool to the tools parameter and pass the image in the input parameter in multimodal format.
inputparameter must contain image content. Pass the image URL using theinput_imagetype. You can also pass text using theinput_texttype to provide additional information for the search.
Supported models
Recommended models
For optimal tool calling performance, use the following models:
Qwen-Plus: Qwen3.7-Plus series, Qwen3.6-Plus series, Qwen3.5-Plus series
Qwen-Max: Qwen3.8-Max series, qwen3.7-max-2026-06-08
qwen3.8-27b
Other models
The following models also support this tool, but their performance is not as high as that of the recommended models.
- Qwen-Flash: Qwen3.7-Flash series, Qwen3.6-Flash series, Qwen3.5-Flash series
Getting started
You can run the following code to call the search by image tool through the Responses API and search for similar or related images based on the input image.
Before you start, obtain an API key and configure the API key as an environment variable.
Replace the image_url in the sample code with a publicly accessible image URL.
Streaming output
The search by image tool has a long processing time. You can enable streaming output to retrieve intermediate results in real time.
Billing
Billing involves the following aspects:
- Model call fees: The results from the image search are appended to the prompt. This increases the number of input tokens for the model. You are charged based on the model's standard rate. For pricing details, see the Model Studio console.
- Tool call fees: You are charged per 1,000 calls. The fee is $8.00 for deployments in the Singapore region, while the fee for deployments in North China 2 (Beijing) is $6.881.
FAQ
Q: What image formats and input methods are supported?
A: For more information, see Image limits and File input methods.
The OpenAI SDK does not support passing local file paths.
Q: How many images can be passed?
A: The number of images that you can pass is limited by the model's maximum input length. The total number of tokens for both the images and text must not exceed the maximum value that the model supports. The model searches only one image per call, but you can make multiple calls to process multiple images.
The model decides the number of images to search.