Skip to main content

Overview

The image_search tool lets the model search for existing photographs, diagrams, illustrations, and other images on the web during an Agent API request. Results are returned as structured image_search_results output items, separate from the assistant’s text.

Parameters

Filters

Use filters to constrain the image sources and formats used by image_search.

Domain filter

Use domain_filter in either allowlist mode or denylist mode, not both. For example, ["nasa.gov", "wikimedia.org"] includes only those domains, while ["-gettyimages.com", "-shutterstock.com"] excludes those domains.

Format filter

Use format_filter to return only the listed image formats, such as ["jpeg", "png"].

Filter example

This example allowlists NASA and Wikimedia, restricts results to JPEG and PNG images, and keeps safe search enabled. To use denylist mode instead, replace domain_filter with ["-gettyimages.com", "-shutterstock.com"].

Response shape

When the tool runs, output includes an image_search_results item before the final assistant message.

Streaming events

With stream: true, image search emits two typed reasoning events. Match them by call_id: The completed response also includes the image_search_results output item shown above.

Pricing

Each invocation of the image_search tool is billed at $2.50 per 1,000 tool invocations. See the Pricing page for full details.

Next steps

Web Search

Search the live web for source-grounded text results.

Image attachments

Send an image as input for the model to analyze.

Migrate from Sonar

Map Sonar image-result parameters to the Image Search tool.

API Reference

View the complete Agent API request and response schemas.