# Search Collection

`POST https://api.vultrinference.com/v1/vector_store/{id}/search`

Searches items in a vector store collection for the closest embeddings matches.

## Path parameters

- `id` (string, required): The ID of the vector store collection.

## Body (application/json)

- `input` (string, required): The text query to search against the embeddings items in the vector store collection.

## Responses

- `200`: OK (search-vector-store-response-payload)
- `400`: Bad Request, including a request that failed validation (the message names the rejected field) and a collection, item or file that does not exist. The body is the error envelope. (error-payload)
- `401`: The API key is missing, unknown or not active. Send it as Authorization: Bearer <key>. (error-payload)
- `502`: The embeddings service failed to embed the input (error-payload)
- `503`: The embeddings service is unavailable; retry shortly (error-payload)

## Example

```bash
curl https://api.vultrinference.com/v1/vector_store/{id}/search \
  -H "Authorization: Bearer $VULTR_INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "string"
  }'
```

```python
import os
import requests

response = requests.post(
    "https://api.vultrinference.com/v1/vector_store/{id}/search",
    headers={"Authorization": f"Bearer {os.environ['VULTR_INFERENCE_API_KEY']}"},
    json={
        "input": "string",
    },
)
print(response.json())
```

```javascript
const response = await fetch("https://api.vultrinference.com/v1/vector_store/{id}/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VULTR_INFERENCE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "input": "string"
  }),
});
console.log(await response.json());
```
