Skip to content

Rerank

POST /<lane>/v1/rerank — Cohere/Jina-style reranking. Given a query and a list of documents, returns documents ordered by relevance.

Terminal window
curl "https://api.opengateway.one/oss/v1/rerank" \
-H "Authorization: Bearer $OPENGATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "BAAI/bge-reranker-v2-m3",
"query": "how do I set the base URL?",
"documents": [
"Set OPENGATEWAY_API_KEY in your shell.",
"The OpenAI SDK base URL includes /v1.",
"Lanes are path prefixes like /oss."
],
"top_n": 2
}'
{
"results": [
{ "index": 1, "relevance_score": 0.92 },
{ "index": 2, "relevance_score": 0.41 }
]
}