v16

latestOpenAPI 3.1.0raw.githubusercontent.com2026-03-032765158.3 KB
Queries

Top Documents

Get the top K documents that match the given query

post/queries/top-documents

Request body

collection_namestring required

The name of the collection.

querystring nullable required

The natural language query to search with. This cannot exceed 4096 UTF-8 bytes. If null, then the sort will be undefined. The purpose of null is to do faster metadata filter searches without care for relevancy. Cost per query is unchanged.

kinteger required

The number of documents to return. If there are not enough documents matching your filters, then fewer may be returned. This number must be between 1 and 2048, inclusive.

filterStrJson
include_metadataboolean

Whether or not to include the metadata in the top documents response. If not provided, then the default will be False.

rerankerstring nullable

The reranker to use after initial retrieval. The default is null. You can find available model ids along with more information at /models/rerank.

latency_mode'low' | 'high'

This option selects between our two latency modes. The higher latency mode takes longer, but can allow for more accurate responses. If desired, test both to customize your search experience for your particular use-case, or use the default of "low" and only swap if you need an additional improvement in search result quality.

Response

Successful Response