Re-order a list of documents by relevance to a query using a dedicated reranker model.
Reranking takes a query and a list of candidate documents and returns them sorted by relevance score. It is the retrieval step that sits between a vector search (which returns approximate neighbours fast) and the model prompt (which needs the most relevant passages, not just the closest vectors).
The openai SDK has no rerank resource, so call POST /v1/rerank directly with fetch.
| Field | Description |
|---|---|
results | Array sorted by relevance_score descending |
results[].index | Original position in the documents array — the text itself is not echoed back |
results[].relevance_score | Float 0–1; higher = more relevant |
usage.search_units | Billing unit (falls back to total_tokens for token-billed rerankers) |
Reranking is billed in DA per search unit (provider-dependent; token-billed models bill by total_tokens). Rates appear on each model's catalog page.