Skip to main content
The /v1/rerank endpoint takes a query string and a list of candidate documents, and returns them sorted by relevance to the query. Reranking is typically used as a second-pass filter after a fast initial retrieval step — for example, after a vector similarity search in a RAG pipeline — to improve the quality of the top results passed to a language model. Anyone’s rerank endpoint is compatible with both the Cohere Rerank API format and the Jina Rerank API format.

POST /v1/rerank

Request body

string
required
The reranking model to use. For example, rerank-english-v3.0 (Cohere) or jina-reranker-v2-base-multilingual (Jina). The available models depend on your configured channels.
string
required
The search query to rank the documents against.
string[] | object[]
required
The list of documents to rank. Each element can be a plain string, or an object with a text field containing the document text.
integer
The number of top-ranked results to return. If omitted, all documents are returned sorted by relevance score.
boolean
If true, each result includes the original document text in addition to the index and relevance score. Defaults to false.
integer
Maximum number of chunks per document when the provider splits long documents internally.
integer
Number of overlapping tokens between chunks when the provider splits long documents.

Response

object[]
Ranked list of document results, ordered from most to least relevant.
object
Token usage for the request.

Example

Example response


Supported providers