Skip to main content
POST
/
models
/
rerank
Rerank
curl --request POST \
  --url https://api.zeroentropy.dev/v1/models/rerank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "query": "<string>",
  "top_n": 123,
  "documents": [
    "<string>"
  ]
}'
{
  "results": [
    {
      "index": 123,
      "relevance_score": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

The Authorization header must be provided in the format Bearer <your-api-key>.

You can get your API Key at the Dashboard!

Body

application/json
query
string
required

The query to rerank the documents by.

documents
string[]
required

The list of documents to rerank. Each document is a string.

model
string

The model ID to use for reranking. Options are: ["zerank-1", "zerank-1-small"]

top_n
integer | null

If provided, then only the top n documents will be returned in the results array. Otherwise, n will be the length of the provided documents array.

Response

Successful Response

results
RerankResult · object[]
required

The results, ordered by descending order of relevance to the query.

I