Reranker API

Your search returns fifty plausible results and three of them actually answer the question. A reranker reads the question and each result together and tells you which three. One request, a list of scores back, no index to build and nothing to keep in sync.

POST /v1/rerankCohere / Jina request shapeApache 2.0 weightsBilled per token, not per search

What a reranker does

It does not chat and it does not generate text. You hand it one question and a list of documents; it returns a relevance score for each. The reason it is more accurate than the search that produced the list is that it reads the question and the document together, in one pass, rather than comparing two vectors that were each computed without knowing the other existed.

That also explains where it belongs. Reading every pair properly costs far more than a vector lookup, so a reranker is not a replacement for your search index — it is the second stage that runs over the shortlist your index produced.

Where it sits in a search pipeline

  1. 1. Retrieve broadly. Your vector search or keyword index returns the top 50–100 candidates. Fast, cheap, approximate.
  2. 2. Rerank. Send the query and those candidates here. They come back ordered by how well each one answers the query.
  3. 3. Use the top few. Put the best three to five in your prompt instead of the best twenty. Better answers, a shorter prompt, and a smaller bill from whichever model writes the reply.

What people use it for

  • RAG that cites the right page — the most common use by far. Retrieval finds twenty plausible chunks; the reranker picks the ones that contain the answer.
  • Support and helpdesk search — matching a customer’s words to articles written in completely different words.
  • Agent tool results — trimming a large file read or search result down to the part worth spending context on.
  • Site and catalogue search — reordering results after retrieval and before they reach the page.

Call it

POST /v1/rerank — the Cohere and Jina request shape, which is what the ecosystem settled on. If you already call a reranker, the body below is probably the one you are sending. This model does not answer /v1/chat/completions; there are no messages to send it.

curlbash
curl https://api.infersia.com/v1/rerank \
  -H "Authorization: Bearer $INFERSIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zeroentropy/zerank-2",
    "query": "how do I rotate an API key?",
    "documents": [
      "Create a replacement key in the console, then revoke the old one.",
      "The Great Wall of China is over 21,000 km long.",
      "API keys are shown once at creation time."
    ],
    "top_n": 3,
    "return_documents": true
  }'

In Python. This one is not an OpenAI SDK call: /v1/rerank is not part of the OpenAI API, so the client has no method for it and a plain HTTP request is the honest way to show it.

rerank.pypython
import os
import requests

# In your own code these come from the search you just ran — the query the
# user typed, and the 50-100 candidates your vector or keyword index returned.
query = "how do I rotate an API key?"
candidates = [
    "Create a replacement key in the console, then revoke the old one.",
    "The Great Wall of China is over 21,000 km long.",
    "API keys are shown once at creation time.",
]

# No f-string around the key: nesting quotes inside one is a syntax error
# before Python 3.12, and this snippet should run wherever you paste it.
api_key = os.environ["INFERSIA_API_KEY"]

response = requests.post(
    "https://api.infersia.com/v1/rerank",
    headers={"Authorization": "Bearer " + api_key},
    json={
        "model": "zeroentropy/zerank-2",
        "query": query,
        "documents": candidates,
        "top_n": 3,
        "return_documents": False,
    },
    timeout=30,
)
response.raise_for_status()

# Results come back sorted, best first, and each "index" points back into the
# list you sent — so you reorder your own objects, not their text.
best = [candidates[r["index"]] for r in response.json()["results"]]
print(best[0])

top_n caps how many results come back. return_documents echoes each document’s text alongside its score if you would rather not keep your own copy — leave it off and you get back scores and indices, which is smaller and usually all you need.

Reading the scores

Every result carries a relevance_score between 0 and 1 and an index pointing back into the array you sent, so you can reorder your own objects without round-tripping their text. Results arrive sorted, best first.

Scores are calibrated to the model author’s own published scale, which is the part worth knowing if you are migrating: a threshold you tuned against zerank elsewhere carries over unchanged rather than needing to be re-derived against a different distribution.

The model behind it

zerank-2 — a Qwen3-4B cross-encoder from ZeroEntropy, released under Apache 2.0. It is the reranker Notion AI ran in production before acquiring its maker, and it tops the author’s published NDCG@10 comparisons against commercial rerankers, with particular strength in finance, legal, medical and code retrieval.

The weights are open, so those claims are checkable rather than taken on trust, and the precision we serve them at is published on the model page like every other model in the catalogue.

What it costs

How that compares

Rerankers are not all sold in the same unit, so this table only lists the vendors who publish a per-token rate. Figures read off each vendor’s own pricing page on 7 August 2026.

ProviderModelPublished price
Voyage AIrerank-2.5$0.05 / 1M tokens
Voyage AIrerank-2.5-lite$0.02 / 1M tokens

Source, fetched 7 August 2026: docs.voyageai.com/docs/pricing. Prices change and this table does not update itself — check the source before you make a decision on it.

Coming from Cohere Rerank?

The request body is the same shape, so the change is a URL, a key and a model id. The pricing is not the same shape, and that is the part worth reading twice.

Cohere bills Rerank in search units. Their pricing FAQ defines one as a single query with up to 100 documents, and notes that documents longer than 500 tokens are split into chunks with each chunk counted as a separate document. We bill the tokens the model actually read. Neither unit converts into the other without assuming how long your documents are, so we have deliberately left Cohere out of the table above rather than publish our assumption with their name on it — run both against your own corpus and compare the invoices, which is the only comparison that is really about you.

The practical difference is where the cliff is. Per-search-unit pricing charges the same for a query over three short paragraphs as for one over a hundred, and chunks long documents into more units than you sent. Per-token pricing tracks the work, so a shortlist of five costs a tenth of a shortlist of fifty instead of the same.

Search-unit definition read from cohere.com/pricing on 7 August 2026.

Where to go next

The model

Precision served, context length, accepted parameters and licence.

zerank-2 →

The docs

Authentication, error shapes, rate limits and how billing is metered.

Quickstart →

The rest of the catalogue

The chat models that write the answer once the reranker has found the evidence.

All models →

Your documents are not retained

What we keep about a rerank is the token count we billed you on, its cost and whether it succeeded. Our usage table has no column the query or the documents could be written into, so keeping them would take a schema migration rather than a lapse — the reasoning is set out in full on the transparency page.