Skip to main content
POST
/
v1
/
rerank
Rerank
curl --request POST \
  --url https://api.vivgrid.com/v1/rerank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "BAAI/bge-reranker-base",
  "query": "What is fast text search?",
  "documents": [
    "Text search indexes terms for fast lookup.",
    "Weather today is sunny."
  ],
  "top_n": 1
}
'
{
  "results": [
    {
      "index": 123,
      "relevance_score": 123,
      "document": "<string>"
    }
  ],
  "object": "<string>",
  "model": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required

BAAI/bge-reranker-base.

query
string
required

Query to rank documents against.

documents
string[]
required

List of documents to rerank.

top_n
integer

Number of top documents to return.

Required range: x >= 1
return_documents
boolean
default:true

Whether to include document text in the response.

user
string

End-user identifier.

Response

Rerank results

results
object[]
required
object
string
model
string