curl --request POST \
--url https://api.siliconflow.com/v1/rerank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "Qwen/Qwen3-Reranker-8B",
"query": "Apple",
"documents": [
"apple",
"banana",
"fruit",
"vegetable"
]
}
'import requests
url = "https://api.siliconflow.com/v1/rerank"
payload = {
"model": "Qwen/Qwen3-Reranker-8B",
"query": "Apple",
"documents": ["apple", "banana", "fruit", "vegetable"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'Qwen/Qwen3-Reranker-8B',
query: 'Apple',
documents: ['apple', 'banana', 'fruit', 'vegetable']
})
};
fetch('https://api.siliconflow.com/v1/rerank', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"results": [
{
"document": {
"text": "<string>"
},
"index": 123,
"relevance_score": 123
}
],
"tokens": {
"input_tokens": 123,
"output_tokens": 123
}
}{
"code": 20012,
"message": "<string>",
"data": "<string>"
}"Invalid token""404 page not found"{
"message": "Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.com. Details:TPM limit reached.",
"data": "<string>"
}{
"code": 50505,
"message": "Model service overloaded. Please try again later.",
"data": "<string>"
}"<string>"Create rerank
Creates a rerank request.
curl --request POST \
--url https://api.siliconflow.com/v1/rerank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "Qwen/Qwen3-Reranker-8B",
"query": "Apple",
"documents": [
"apple",
"banana",
"fruit",
"vegetable"
]
}
'import requests
url = "https://api.siliconflow.com/v1/rerank"
payload = {
"model": "Qwen/Qwen3-Reranker-8B",
"query": "Apple",
"documents": ["apple", "banana", "fruit", "vegetable"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'Qwen/Qwen3-Reranker-8B',
query: 'Apple',
documents: ['apple', 'banana', 'fruit', 'vegetable']
})
};
fetch('https://api.siliconflow.com/v1/rerank', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"results": [
{
"document": {
"text": "<string>"
},
"index": 123,
"relevance_score": 123
}
],
"tokens": {
"input_tokens": 123,
"output_tokens": 123
}
}{
"code": 20012,
"message": "<string>",
"data": "<string>"
}"Invalid token""404 page not found"{
"message": "Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.com. Details:TPM limit reached.",
"data": "<string>"
}{
"code": 50505,
"message": "Model service overloaded. Please try again later.",
"data": "<string>"
}"<string>"Authorizations
Body
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.
Qwen/Qwen3-Reranker-8B, Qwen/Qwen3-Reranker-4B, Qwen/Qwen3-Reranker-0.6B "Qwen/Qwen3-Reranker-8B"
Required. The search query.
"Apple"
Currently, only string lists are supported. Document objects will be supported in the future.
1["apple", "banana", "fruit", "vegetable"]
Number of most relevant documents or indices to return.
4
If false, the response does not include document text; if true, it includes the input document text.
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, netease-youdao/bce-reranker-base_v1 support this field.
Number of token overlaps between adjacent chunks when documents are chunked. only BAAI/bge-reranker-v2-m3, netease-youdao/bce-reranker-base_v1 support this field.
x <= 80