Qwen3-Reranker-8B. The body is the Cohere-style rerank shape. The OpenAI SDKs have no rerank method, so call the endpoint directly.
Example
Request
return_documents and rank_fields are accepted and have no effect.
Response
index points into your documents list, so documents[r["index"]] is the scored text. Each result also echoes the document’s text in document.text. A higher relevance_score means a closer match to the query. Sort by relevance_score when order matters to you.
To pick the single best document, continuing the example above:
Python
Billing
A rerank call bills on input tokens only: the query plus every document. It generates nothing, so output is free.usage.prompt_tokens is the count you are billed for. Rates are on the model page and in GET /v1/models.
See also
- Embeddings — retrieve candidates first, then rerank them.
- Model discovery — rerank models have
category: "rerank".