Skip to main content
POST
/
v1
/
rerank
Rerank documents
curl --request POST \
  --url https://api.tokenfactory.nebius.com/v1/rerank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "query": "<string>",
  "documents": [
    "<string>"
  ],
  "user": "<string>",
  "service_tier": "auto"
}
'
{
  "id": "rerank-bbbxyuxyu643b6af",
  "model": "Qwen/Qwen3-Reranker-8B",
  "usage": {
    "prompt_tokens": 65,
    "total_tokens": 65
  },
  "results": [
    {
      "index": 1,
      "document": {
        "text": "Belgrade"
      },
      "relevance_score": 0.9456538558006287
    },
    {
      "index": 2,
      "document": {
        "text": "Shrek's swamp"
      },
      "relevance_score": 0.8282327651977539
    },
    {
      "index": 0,
      "document": {
        "text": "Amsterdam"
      },
      "relevance_score": 0.16313764452934265
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Query Parameters

ai_project_id
string | null

current project ID

Body

application/json
model
string
required

ID of the model to use.

Example:

"Qwen/Qwen3-Reranker-8B"

query
string
required

Query to rerank, encoded as a string.

Example:

"What is the capital of France?"

documents
string[]
required

Documents to rerank, encoded as a list of strings.

Example:
[
"The capital of Brazil is Brasilia.",
"The capital of France is Paris.",
"Amsterdam",
"Belgrade"
]
user
string | null

A unique identifier representing your end-user.

service_tier
enum<string> | null
default:auto

The service tier to use for the request.

Available options:
auto,
default,
over-limit,
flex,
no-limit
Example:

"auto"

Response

OK

id
string
required

A unique identifier for the reranking response.

model
string
required

The model used for the reranking.

usage
RerankUsage · object
required

Token usage stats.

results
RerankResult · object[]
required

List of RerankResult objects