Nebul Docs

Rerank Documents

POST
/v1/rerank

Rerank a list of documents based on their relevance to a query.

curl -X POST https://api.inference.nebul.io/v1/rerank \-H "Content-Type: application/json" \-H "Authorization: Bearer sk-1234" \-d '{    "model": "BAAI/bge-reranker-v2-m3",    "query": "What is machine learning?",    "documents": [        "Document 1 text...",        "Document 2 text..."    ],    "top_n": 3}'

Authorization

X-API-Key<token>

Project-scoped Nebul API key. Also accepted as Authorization: Bearer <key>.

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://example.com/v1/rerank" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "query": "string"  }'
{  "id": "string",  "model": "string",  "results": [    {      "index": 0,      "relevance_score": 0,      "document": "string"    }  ],  "usage": {}}