API reference · API
Search a vector store
POST/v1/vector_stores/{id}/searchAPI key
The query is embedded with the store's model on the key's account (billed, in x-antimatter-cost-micros) and the store's chunks are ranked by cosine similarity. No reranker and no query rewriting; x-antimatter-vector-search says whether every chunk was scored (exact) or libsql's vector index answered (index, approximate).
Parameters
| Field | Type | What it is |
|---|---|---|
| id (path)required | string | The vector store id, vs_ and 24 hex digits. |
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| queryrequired | string or array of string | |
| filters | VectorFilter | A comparison on a file attribute, or a compound of filters. A comparison on a key the file does not carry fails, except ne and nin. |
| max_num_results | integer | From 1 to 50. |
| ranking_options | object | |
| ranking_options. | string | One of "none", "auto", "default-2024-11-15". |
| ranking_options. | number | From 0 to 1. |
| rewrite_query | boolean | Accepted; the query is used as given and x-antimatter-adjusted says so. |
Example
{
"query": "string"
}Answer 200
The nearest chunks, best first.
| Field | Type | What it is |
|---|---|---|
| object | "vector_store.search_results.page" | |
| search_query | array of string | |
| data | array of object | |
| data[] | string | |
| data[] | string | |
| data[] | number | From 0 to 1. |
| data[] | object or null | At most 16 pairs; keys up to 64 characters, values a string up to 512 characters, a number or a boolean. |
| data[] | array of object | |
| data[] | "text" | |
| data[] | string | |
| has_more | boolean | |
| next_page | string or null |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 402OpenAI shaped error.
- 403OpenAI shaped error.
- 404OpenAI shaped error.
- 429OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.