Skip to main content
POST
Rerank
Rerank a list of documents by relevance to a query. Returns documents sorted by relevance score.

Authenticate

Use an API key in the Authorization header.

Request body

string
required
Reranking model ID to use. See available rerank models for the full list.Examples: rerank-2.5, rerank-2.5-lite
string
required
The search query to rank documents against.
array
required
List of documents to rerank. Pass an array of strings or objects with a text field.
integer
Number of top results to return. Defaults to the total number of documents.
boolean
default:"false"
Whether to include the document text in the response.

Response

string
Unique identifier for the rerank request.
array
Reranked documents sorted by relevance score descending.
object
Token usage statistics.

Examples