curl --request POST \
--url https://api.openai.com/v1/vector_stores/{vector_store_id}/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"rewrite_query": false,
"max_num_results": 10,
"filters": {
"type": "eq",
"key": "<string>",
"value": "<string>"
},
"ranking_options": {
"ranker": "auto",
"score_threshold": 0
}
}
'{
"object": "vector_store.search_results.page",
"search_query": [
"<string>"
],
"data": [
{
"file_id": "<string>",
"filename": "<string>",
"score": 0.5,
"attributes": {},
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
],
"has_more": true,
"next_page": "<string>"
}Search a vector store for relevant chunks based on a query and file attributes filter.
curl --request POST \
--url https://api.openai.com/v1/vector_stores/{vector_store_id}/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"rewrite_query": false,
"max_num_results": 10,
"filters": {
"type": "eq",
"key": "<string>",
"value": "<string>"
},
"ranking_options": {
"ranker": "auto",
"score_threshold": 0
}
}
'{
"object": "vector_store.search_results.page",
"search_query": [
"<string>"
],
"data": [
{
"file_id": "<string>",
"filename": "<string>",
"score": 0.5,
"attributes": {},
"content": [
{
"type": "text",
"text": "<string>"
}
]
}
],
"has_more": true,
"next_page": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the vector store to search.
"vs_abc123"
A query string for a search
Whether to rewrite the natural language query for vector search.
The maximum number of results to return. This number should be between 1 and 50 inclusive.
1 <= x <= 50A filter to apply based on file attributes.
Show child attributes
Ranking options for search.
Show child attributes
OK
The object type, which is always vector_store.search_results.page
vector_store.search_results.page The query used for this search.
The list of search result items.
Show child attributes
Indicates if there are more results to fetch.
The token for the next page, if any.
Was this page helpful?