Reranking
Overview
Reranking improves search relevance by reordering candidate results based on their semantic similarity to a query, helping you surface the most relevant content to users.
Learn more about reranking in our detailed guide covering use cases, integration patterns, and optimization techniques.
Rerank Documents
POST/v1/reranking
Reorders a list of documents or text snippets based on their relevance to a given query, improving search result quality.
Authorization
- Authorization
Authorization
- Type
- string
- Required or Optional
- required
Bearer token for API authentication. Format: `Bearer YOUR_API_KEY`
Request Body
- model
model
- Type
- string
- Required or Optional
- required
The identifier of the reranking model to use.Constraints:Must be a valid model. Refer to our supported models.- query
query
- Type
- string
- Required or Optional
- required
The search query text.- input
input
- Type
- string[] | object[]
- Required or Optional
- required
The list of documents to be reranked.Constraints:Documents exceeding token limit will be truncated.- rank_fields
rank_fields
- Type
- string[]
- Required or Optional
- optional
Specifies object fields to use for ranking when input contains objects.Constraints:Must adhere to JMESPath or a similar JSON query language syntax.- top_k
top_k
- Type
- integer
- Required or Optional
- optional
The maximum number of top results to return.- return_input
return_input
- Type
- boolean
- Required or Optional
- optional
Specifies whether to include the original input documents in the response.- rewrite_query
rewrite_query
- Type
- boolean
- Required or Optional
- optional
- Default
- default:
false
Specifies whether to rewrite the query before performing reranking for improved relevance.
Response Body
- model
model
- Type
- string
- Required or Optional
- required
The model identifier used for the request.- top_k
top_k
- Type
- integer
- Required or Optional
- required
The maximum number of top documents returned.- return_input
return_input
- Type
- boolean
- Required or Optional
- required
Indicates whether the original input documents are included in the response.- object
object
- Type
- string
- Required or Optional
- required
The type of the response object.- data
data
- Type
- RankedDocument[]
- Required or Optional
- required
A list of the reranked document objects.- usage
usage
- Type
- object
- Required or Optional
- required
An object detailing the token usage for the request.
Parsing
API reference for managing document parsing in Mixedbread. This documentation covers all essential endpoints to get you started with document parsing.
SDKs
Access Mixedbread's API with our easy-to-use SDKs for Python and TypeScript.
Last updated: June 11, 2025