Skip to main content
POST https://api.pinference.ai/api/v1/rerank scores each document against a query and returns the documents most relevant first. Prime Inference serves one reranker, Qwen3 Reranker 0.6B, as qwen/qwen3-reranker-0.6b. The reranker doesn’t take Chat Completions requests.
The same request in Python:
To charge a team, add -H "X-Prime-Team-ID: your-team-id" to each request. See team billing.

Request body

The model reads each document in its own prompt, with the query, the instruction and the prompt template. One prompt can hold 32,768 tokens, template included. A longer prompt is refused with a 400, and nothing is truncated. Split or shorten long documents before you send them. The whole request body can be at most 16 MiB.

Response

Results are sorted by the model’s raw score, the logit behind each probability. Documents with equal logits keep their request order. Two documents with very high logits can both score exactly 1.0. The response doesn’t include logits, so keep the order of results and don’t re-sort by relevance_score.

Usage and billing

Reranking is billed on input tokens, usage.total_tokens, at $0.20 per million. There is no output charge. Each document is billed for its own tokens, the query’s tokens and about 70 tokens of default instruction and template.

Errors

Most errors return an error object with message, type and code, as the Chat Completions API does. A 401, a 404, or a 503 while authentication is unavailable returns a detail message instead.

OpenRouter compatibility

Requests and responses use the same fields as OpenRouter’s rerank API, which follows Cohere’s naming. A client written for that API works with Prime Inference after you change its base URL and API key. The instruction field is specific to Prime Inference.