/v1/rerank endpoint to reorder a set of candidate documents by their relevance to a given query. This is especially valuable in retrieval-augmented generation (RAG) pipelines and search systems, where a fast first-stage retriever returns a broad candidate set and a reranker then refines the ordering for precision before passing results to a language model.
Request
POSThttps://kiosapi.com/v1/rerank
Headers
string
required
Must be
application/json.string
required
Your API key in the format
Bearer sk-xxx.Request Body
string
required
The rerank model to use. Example:
gte-rerank-v2.string
required
The query text to rank the documents against.
array
required
An array of candidate document strings to be scored and reordered.
integer
The maximum number of top-ranked documents to return. Defaults to returning all documents.
boolean
When
true, the original document text is included in each result object. Defaults to false.Example Request
- cURL
- Python
Response
Results are returned in descending relevance order. Each result includes the original document index and a relevance score between 0 and 1.Response Fields
array
An array of ranked result objects, sorted from most to least relevant.
integer
The number of tokens consumed by the query and documents.
integer
Total tokens processed for this request.