Reranks a list of documents by relevance to a query text
Request
Provide your bearer token in the Authorization
header when making requests to protected resources. Example:Authorization: Bearer ********************
or
Body Params application/jsonRequired
{
"model": "bge-rerank-v3",
"query": "What is POLOAPI",
"documents": [
"POLOAPI is an enterprise-grade AI gateway platform",
"The weather is nice today",
"POLOAPI supports unified access to multiple AI models"
],
"top_n": 3,
"return_documents": true
}
Request Code Samples
curl --location '/v1/rerank' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "bge-rerank-v3",
"query": "What is POLOAPI",
"documents": [
"POLOAPI is an enterprise-grade AI gateway platform",
"The weather is nice today",
"POLOAPI supports unified access to multiple AI models"
],
"top_n": 3,
"return_documents": true
}'
Responses
Successfully returns reranking result
{
"id": "rerank-abc123",
"model": "bge-rerank-v3",
"results": [
{
"index": 0,
"relevance_score": 0.95,
"document": {
"text": "POLOAPI is an enterprise-grade AI gateway platform"
}
},
{
"index": 2,
"relevance_score": 0.88,
"document": {
"text": "POLOAPI supports unified access to multiple AI models"
}
},
{
"index": 1,
"relevance_score": 0.12,
"document": {
"text": "The weather is nice today"
}
}
],
"usage": {
"prompt_tokens": 30,
"total_tokens": 30
}
}
Modified at 2026-08-18 09:37:53