Skip to main content

Rerank

POST /v1/rerank

Scores and reorders a set of documents by relevance to a query (Jina / Cohere Rerank compatible). Commonly used to refine RAG recall.

RequestREQUEST
POSThttps://test.kailin.com.cn/v1/rerank
ResponseRESPONSE
Fill in the request and hit Send — the response shows up here

Request​

curl https://test.kailin.com.cn/v1/rerank \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{
"model": "jina-reranker-v2-base-multilingual",
"query": "What is vector search",
"documents": [
"Vector search computes semantic similarity over embedding vectors",
"The weather is nice today",
"RAG systems typically retrieve first, then rerank"
],
"top_n": 2
}'

Request Body​

ParameterTypeRequiredDescription
modelstringYesRerank model — see the available list
querystringYesQuery text
documentsarrayYesDocuments as strings or { "text": "..." } objects
top_nintegerNoReturn only the top N results, default all
return_documentsbooleanNoInclude the original text in results, default false

Response​

{
"results": [
{
"index": 0,
"relevance_score": 0.93,
"document": { "text": "Vector search computes semantic similarity over embedding vectors" }
},
{
"index": 2,
"relevance_score": 0.71,
"document": { "text": "RAG systems typically retrieve first, then rerank" }
}
],
"usage": {
"total_tokens": 120
}
}
FieldDescription
results[].indexOriginal index in the input documents array
results[].relevance_scoreRelevance score, higher is more relevant
usage.total_tokensBilled tokens (may be absent on some channels)
tip

Typical pattern: vector recall top 50 → rerank to top 5 → feed into the chat model as context.