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"
OK
The response is of type object
.
Was this page helpful?