Rerank documents
rerankOrder documents by how well they answer a query, best first, with a relevance score each. Same as POST /v1/rerank. Typical use: a vector or keyword search finds 50–100 candidates, rerank picks the few that really answer the question, and only those go to the model — answers get more accurate and prompts shorter.
results[].index points into the documents list you sent. Scores are comparable only within one response.
Spends money from the account balance: Cohere models are billed per search (up to 100 documents), the rest per input token. usage.cost_rub is what this call cost.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model id from the catalogue, vendor included and matched exactly, e.g. "cohere/rerank-v3.5". Find one with models_search and tool: "rerank". | |
| query | Yes | The question or search query to rank the documents against. | |
| top_n | No | Return only this many best documents. Leave out to get all of them, ranked. | |
| documents | Yes | Candidate documents as plain text, 1 to 1000 of them. Their order in the answer is by relevance. |