v2

latestOpenAPI 3.1.02026-07-2670186350.6 KB
rerank

Rerank Documents

Rerank documents based on relevance to a query.

This endpoint allows you to rerank a list of documents based on their relevance to a given query using state-of-the-art reranking models.

The documents will be returned in order of relevance, with the most relevant documents first. Each result includes the original document index and a relevance score.

post/rerank

Request body

querystring required

The search query to rank documents against

modelstring required

The reranking model to use

top_kinteger nullable

Number of top documents to return. Defaults to all documents.

return_documentsboolean

Whether to return document content in the response

max_chunks_per_docinteger nullable

Maximum number of chunks per document

Response

Successful Response

idstring required

Unique identifier for this rerank request

modelstring required

The model used for reranking

usageobject required

Usage information