Rerank
Scores and reorders a set of documents by relevance to a query (Jina / Cohere Rerank compatible). Commonly used to refine RAG recall.
RequestREQUEST
POST
https://test.kailin.com.cn/v1/rerankResponseRESPONSE
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
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Rerank model — see the available list |
query | string | Yes | Query text |
documents | array | Yes | Documents as strings or { "text": "..." } objects |
top_n | integer | No | Return only the top N results, default all |
return_documents | boolean | No | Include 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
}
}
| Field | Description |
|---|---|
results[].index | Original index in the input documents array |
results[].relevance_score | Relevance score, higher is more relevant |
usage.total_tokens | Billed 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.