v126

latestOpenAPI 3.1.0MITraw.githubusercontent.com2026-08-04957391.2 MB
Rerank

Submit a rerank request

Submits a rerank request to the rerank router

post/rerank

Request body

modelstring required

The rerank model to use

querystring required

The search query to rerank documents against

top_ninteger

Number of most relevant documents to return

Example request

{
  "documents": [
    "Paris is the capital of France.",
    "Berlin is the capital of Germany."
  ],
  "model": "cohere/rerank-v3.5",
  "query": "What is the capital of France?",
  "top_n": 3
}

Response

Rerank response

idstring

Unique identifier for the rerank response (ORID format)

modelstring required

The model used for reranking

providerstring

The provider that served the rerank request

Example response

{
  "id": "gen-rerank-1234567890-abc",
  "model": "cohere/rerank-v3.5",
  "results": [
    {
      "document": {
        "text": "Paris is the capital of France."
      },
      "index": 0,
      "relevance_score": 0.98
    }
  ],
  "usage": {
    "search_units": 1,
    "total_tokens": 150
  }
}