Search vector store
POST/vector_stores/{vector_store_id}/search
Search a vector store for relevant chunks based on a query and file attributes filter.
Path Parameters
vector_store_id: string
Body ParametersJSON
max_num_results: optional number
The maximum number of results to return. This number should be between 1 and 50 inclusive.
minimum1
maximum50
rewrite_query: optional boolean
Whether to rewrite the natural language query for vector search.
Returns
has_more: boolean
Indicates if there are more results to fetch.
next_page: string
The token for the next page, if any.
object: "vector_store.search_results.page"
The object type, which is always vector_store.search_results.page
search_query: array of string
Search vector store
curl https://api.openai.com/v1/vector_stores/$VECTOR_STORE_ID/search \
-H 'Content-Type: application/json' \
-H 'OpenAI-Beta: assistants=v2' \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"query": "string"
}'{
"data": [
{
"attributes": {
"foo": "string"
},
"content": [
{
"text": "text",
"type": "text"
}
],
"file_id": "file_id",
"filename": "filename",
"score": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "vector_store.search_results.page",
"search_query": [
"string"
]
}Returns Examples
{
"data": [
{
"attributes": {
"foo": "string"
},
"content": [
{
"text": "text",
"type": "text"
}
],
"file_id": "file_id",
"filename": "filename",
"score": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "vector_store.search_results.page",
"search_query": [
"string"
]
}