The text-to-image search tool enables a model to search the Internet for relevant images based on a text description. The model can then describe the image content and perform inference. This is useful for scenarios such as visual Q&A and image recommendations.
Usage
You can call the text-to-image search feature using the Responses API. Add the web_search_image tool to the tools parameter.
Supported models
Recommended models
For the best tool calling results, 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 call, but their performance is not as good as that of the recommended models.
- Qwen-Flash: Qwen3.7-Flash series, Qwen3.6-Flash series, Qwen3.5-Flash series
Getting started
Run the following code to call the text-to-image search tool using the Responses API. This code searches the Internet for images based on a text description.
You must obtain an API key and configure the API key as an environment variable.
Streaming output
The text-to-image search tool can be slow. You can enable streaming output to receive intermediate results in real time.
Billing
Billing includes the following:
- Model call fees: The image search results are added to the prompt. This increases the number of input tokens for the model. You are charged based on the standard pricing for the model. For pricing details, see the Model Studio console.
- Tool call fees: The fee for every 1,000 calls is: $8 for deployments in the Singapore region, and $3.44 for deployments in North China 2 (Beijing).