/rerank

Rerank

Rank a list of documents according to their relevance to a query.

The total request cannot exceed 400,000 tokens. The combined length of any document, instruction and the query must not exceed 4,000 tokens.

post/rerank

Request body

querystring required

The string against which documents will be ranked for relevance

documentsstring[] required

The texts to be reranked according to their relevance to the query

modelstring required

The version of the reranker to use. Currently, we just have "v1".

top_ninteger

The number of top-ranked results to return

instructionstring

The instruction to be used for the reranker

metadatastring[]

Metadata for documents being passed to the reranker. Must be the same length as the documents list.

Response

Successful Response

Changes