POST
/
rerank

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Specifies the model to be used.

Available options:
BAAI/bge-reranker-v2-m3,
netease-youdao/bce-reranker-base_v1
query
string
default: Applerequired

Required. The search query.

documents
string[]
required

Required. List of documents to be reordered. If document objects are provided, the 'text' field is mandatory, and other fields will be preserved in the response.

top_n
integer

Number of most relevant documents or indices to return.

return_documents
boolean
default: false

If false, the response does not include document text; if true, it includes the input document text.

max_chunks_per_doc
integer
default: 1024

Maximum number of chunks generated from within a document. Long documents are divided into multiple chunks for calculation, and the highest score among the chunks is taken as the document's score.

overlap_tokens
integer
default: 80

Number of token overlaps between adjacent chunks when documents are chunked.

Required range: x < 80

Response

200 - application/json
id
string
required
results
object[]
required
results.document
object

Original document content.

results.document.text
string
results.index
integer

The index value of the position in the input candidate doc array.

results.relevance_score
number

Similarity score.

tokens
object
required
tokens.input_tokens
integer
tokens.output_tokens
integer