Reranks a list of documents by relevance to a query text
Request
Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Header Params
Body Params application/jsonRequired
Example
{"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
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location'/v1/rerank' \
--header'X-Request-Id;' \
--header'X-Tenant-Id;' \
--header'X-Channel;' \
--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
🟢200
application/json
Successfully returns reranking result
Bodyapplication/json
Example
{"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}}