TheDocumentation Index
Fetch the complete documentation index at: https://docs.tokmodel.com/llms.txt
Use this file to discover all available pages before exploring further.
/v1/rerank endpoint takes a search query and a list of documents, then returns the documents ordered by their relevance to the query. Each result includes a relevance score you can use to filter or threshold results before passing them to a language model. Reranking is commonly used as a second-stage retrieval step in RAG pipelines to improve the quality of context sent to a model.
Request parameters
The reranking model to use. Use the list models endpoint to find available reranking model IDs.
The search query against which the documents are ranked.
An array of document strings to rank. Each string is treated as a candidate document. The order of this array determines the
index values in the response.The maximum number of results to return. When omitted, all documents are returned ranked by relevance score.
Response fields
An array of ranked result objects sorted from highest to lowest relevance score.