Mixedbread

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.


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 .
  • 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.
  • A list of the reranked document objects.
  • An object detailing the token usage for the request.

Last updated: June 11, 2025