Rerank
Submit a rerank request
Submits a rerank request to the rerank router
post/rerank
Request body
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
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
}
}