> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.reka.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.reka.ai/_mcp/server.

# Image Search

> Search through indexed images using natural language queries

> **Info**
>
> For chat over text, images and short videos, use the OpenAI-compatible [Chat Completions API](/chat/overview).

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:

1. **Upload images** with `index=true` using the [`/v1/images/upload`](/vision/image-management) endpoint
2. **Wait for indexing** to complete

## Search images

Search indexed images with a natural language description.

### Endpoint

* `POST /v1/images/search`

### Request

#### Bash

```bash
curl -X POST https://vision-agent.api.reka.ai/v1/images/search \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "a red car",
    "max_results": 10,
    "threshold": 0.5
  }'
```

#### Python

```python
import requests

url = f"{BASE_URL}/v1/images/search"
query = "a red car"
limit = 10
payload = {
    "query": query,
    "max_results": limit,
    "threshold": threshold
}
headers = {
    "X-Api-Key": REKA_API_KEY
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
    result = response.json()
    print("Search images successful:", result)
    result
else:
    raise ValueError(f"Error: {response.status_code} {response.text}")
```

### Parameters

* **`query`** (required): Natural language search query describing the image content you're looking for
* **`max_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 image
* **`image_url`**: URL to access the image
* **`score`**: 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