API reference

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

Path and query parameters
FieldTypeWhat it is
id (path)requiredstringThe vector store id, vs_ and 24 hex digits.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
queryrequiredstring or array of string
filtersVectorFilterA 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_resultsintegerFrom 1 to 50.
ranking_optionsobject
ranking_options.rankerstringOne of "none", "auto", "default-2024-11-15".
ranking_options.score_thresholdnumberFrom 0 to 1.
rewrite_querybooleanAccepted; the query is used as given and x-antimatter-adjusted says so.

Example

{
  "query": "string"
}

Answer 200

The nearest chunks, best first.

Fields of the 200 answer
FieldTypeWhat it is
object"vector_store.search_results.page"
search_queryarray of string
dataarray of object
data[].file_idstring
data[].filenamestring
data[].scorenumberFrom 0 to 1.
data[].attributesobject or nullAt most 16 pairs; keys up to 64 characters, values a string up to 512 characters, a number or a boolean.
data[].contentarray of object
data[].content[].type"text"
data[].content[].textstring
has_moreboolean
next_pagestring 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.

Antimatter