Skip to main content
POST
/
v1
/
projects
/
{project_id}
/
vector-stores
/
{vector_store_id}
/
files
/
{file_id}
/
search
Search in vector store's file
curl --request POST \
  --url https://api.example.com/v1/projects/{project_id}/vector-stores/{vector_store_id}/files/{file_id}/search \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-selected-account-id: <api-key>' \
  --data '
{
  "query": "<string>",
  "top_k": 123,
  "filters": {},
  "rerank_config": {
    "model": "<string>",
    "top_n": 2,
    "instruction": "<string>"
  },
  "query_type": "semantic"
}
'
{
  "chunks": [
    {
      "content": "<string>",
      "blocks": [
        {
          "type": "<string>",
          "content": "<string>",
          "bbox": {
            "left": 123,
            "top": 123,
            "width": 123,
            "height": 123
          },
          "confidence": 123,
          "page_number": 0
        }
      ],
      "score": 123,
      "file_id": "<string>",
      "parse_result_id": "<string>",
      "metadata": {}
    }
  ]
}

Authorizations

x-api-key
string
header
required

API key for authentication

x-selected-account-id
string
header
required

Selected Account ID

Path Parameters

project_id
string
required
vector_store_id
string
required
file_id
string
required

Body

application/json

Search parameters for vector store engines. Extend this model to add new parameters without changing the engine interface.

query
string
required

Query to search for

top_k
integer | null

Number of results to return

filters
Filters · object

Filters to apply to the search. For example, {file_id: 123}

rerank_config
RerankConfig · object

Reranking configuration. This is only applicable for SGP Vector Stores.

query_type
enum<string> | null

Type of query to perform.

Available options:
semantic,
lexical,
hybrid

Response

Search completed successfully

chunks
VectorStoreChunk · object[]
required

Chunks of the search result