Rerank

POST
/v1/rerank

Re-ranks a list of documents against a query using an embedding/rerank model.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.vivgrid.com/v1/rerank" \  -H "Content-Type: application/json" \  -d '{    "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  }'
{
  "object": "string",
  "model": "string",
  "results": [
    {
      "index": 0,
      "relevance_score": 0,
      "document": "string"
    }
  ]
}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}