Canonical: https://weaveos.com/reference/cohere/rerank-retrieved-documents

1. [Software capabilities](https://weaveos.com/reference)
2. /[Cohere](https://weaveos.com/reference/cohere)
3. /Rerank retrieved documents with Cohere

[![](https://weaveos.com/reference/logos/cohere.png)Cohere](https://weaveos.com/reference/cohere)

# Rerank retrieved documents with Cohere

Send a query and candidate documents to Cohere’s Rerank API or use Cohere’s Python client. The response orders candidates by relevance and can return only the top results needed by a retrieval pipeline.

Documentation reviewed November 27, 2026 · 2 methods with sources

## Ways to do it

1. [1API: POST /v2/rerank](https://weaveos.com/reference/cohere/rerank-retrieved-documents#method-1)
2. [2SDK: co.rerank()](https://weaveos.com/reference/cohere/rerank-retrieved-documents#method-2)

API

### POST /v2/rerank

Submit a query and list of documents, then read ordered results with relevance scores.

[Read source: Cohere Rerank API v2](https://docs.cohere.com/v2/reference/rerank)

- Requirements

  A Cohere bearer token, a supported rerank model, a query string, and candidate documents.

- Limitations

  Cohere recommends sending no more than 1,000 documents in one request. Documents longer than max\_tokens\_per\_doc are truncated, with a default of 4,096 tokens.

Example shell

Copy

```
curl --fail -X POST https://api.cohere.com/v2/rerank \
  -H "Authorization: Bearer $COHERE_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"rerank-v5.0-pro","query":"incident response","documents":["Runbook A","Runbook B"],"top_n":2}'
```

SDK

### co.rerank()

Call the Python ClientV2 rerank method with the same query and candidate documents.

[Read source: Cohere Rerank model overview](https://docs.cohere.com/v2/docs/rerank-overview)

- Requirements

  Python, the cohere package, a COHERE\_API\_KEY environment variable, and a supported rerank model.

- Limitations

  Set top\_n to bound the result count. The returned indexes refer to documents in the original input order.

Example text

Copy

```
import cohere
co = cohere.ClientV2()
results = co.rerank(model="rerank-v5.0-pro", query="incident response", documents=["Runbook A", "Runbook B"], top_n=2)
```

## More from Cohere

[View all 1 Cohere tasks](https://weaveos.com/reference/cohere)
