Image Search
For chat over text, images and short videos, use the OpenAI-compatible Chat Completions API.
The Image Search API searches your indexed images with natural language queries. Images must be uploaded with index: true to be searchable.
Prerequisites
Before you use Image Search, check that your images are indexed:
- Upload images with
index=trueusing the/v1/images/uploadendpoint - Wait for indexing to complete
Search images
Search indexed images with a natural language description.
Endpoint
POST /v1/images/search
Request
Bash
Python
Parameters
query(required): Natural language search query describing the image content you’re looking formax_results(optional): Maximum number of results to return (default: 10)threshold(optional): Minimum similarity threshold for results (0-1 scale)
Response
Returns an array of images matching the search query, ranked by relevance. Each result includes:
image_id: Unique identifier for the imageimage_url: URL to access the imagescore: Relevance score (0-1 scale)
Use cases
Image search is useful for:
- Content discovery: Find specific images in large collections
- Visual cataloging: Search product images by description
- Media management: Locate images based on visual content
- Quality control: Find images matching specific criteria