Skip to main content

Rerank documents

POST 

/rerank

Scores how relevant each document is to a query, in the format of the rerank APIs of Cohere and Jina, with qwen3-reranker-0.6b (alias qwen/qwen3-reranker-0.6b). At most 1000 documents per request, a query of at most 4096 characters and about 300,000 tokens (the estimate below); the model reads each document with the query up to 8,192 tokens.

The model reports no usage, so the request is billed on an estimate that the API writes into usage: for each document, ceil((characters(query) + characters(document)) / 4) tokens, added up, with characters counted as Unicode code points. Every document is scored and billed, also when top_n returns fewer. Output is not billed. Only Serenity Edge API keys can use this route. See the Embeddings, rerank and redaction guide.

Request​

Responses​

The most relevant documents with their scores, the model id and the estimated tokens the request is billed on. The scores of the example are illustrative; its usage is the estimate for the example request (21 + 25 + 21 tokens).