Skip to main content
POST
/
rerank
Create Rerank
curl --request POST \
  --url https://api.siliconflow.cn/v1/rerank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "BAAI/bge-reranker-v2-m3",
  "query": "Apple",
  "documents": [
    "apple",
    "banana",
    "fruit",
    "vegetable"
  ]
}
'
{
  "id": "<string>",
  "results": [
    {
      "document": {
        "text": "<string>"
      },
      "index": 123,
      "relevance_score": 123
    }
  ],
  "tokens": {
    "input_tokens": 123,
    "output_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer

Body

application/json
model
string
required

Corresponding Model Name. To better enhance service quality, we will make periodic changes to the models provided by this service, including but not limited to model on/offlining and adjustments to model service capabilities. We will notify you of such changes through appropriate means such as announcements or message pushes where feasible. For a complete list of available models, please check the Models.

Example:

"BAAI/bge-reranker-v2-m3"

query
string
required

Required. The search query.

Example:

"Apple"

documents
string[]
required

Currently, only string lists are supported. Document objects will be supported in the future.

Minimum array length: 1
Example:
["apple", "banana", "fruit", "vegetable"]
instruction
string

The instruction for the reranker, only support Qwen/Qwen3-Reranker-8B, Qwen/Qwen3-Reranker-4B,Qwen/Qwen3-Reranker-0.6B.

Example:

"Please rerank the documents based on the query."

top_n
integer

Number of most relevant documents or indices to return.

Example:

4

return_documents
boolean

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

max_chunks_per_doc
integer

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. only BAAI/bge-reranker-v2-m3, Pro/BAAI/bge-reranker-v2-m3, netease-youdao/bce-reranker-base_v1 support this field.

overlap_tokens
integer

Number of token overlaps between adjacent chunks when documents are chunked. only BAAI/bge-reranker-v2-m3, Pro/BAAI/bge-reranker-v2-m3, netease-youdao/bce-reranker-base_v1 support this field.

Required range: x <= 80

Response

200

id
string
required
results
object[]
required
tokens
object
required