给定一个提示,该模型将返回一个或多个预测的完成,并且还可以返回每个位置的替代标记的概率。
为提供的提示和参数创建完成
官方文档:https://docs.siliconflow.cn/cn/api-reference/rerank/create-rerank
/v1/rerank给定一个提示,该模型将返回一个或多个预测的完成,并且还可以返回每个位置的替代标记的概率。
为提供的提示和参数创建完成
官方文档:https://docs.siliconflow.cn/cn/api-reference/rerank/create-rerank
curl -X POST https://top.qingyuntop.ai/v1/rerank \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d ' {
"model": "qwen3-rerank",
"documents": [
"文本排序模型广泛用于搜索引擎 and 推荐系统中,它们根据文本相关性对候选文本进行排序",
"量子计算是计算科学的一个前沿领域",
"预训练语言模型的发展给文本排序模型带来了新的进展"
],
"query": "什么是文本排序模型",
"top_n": 2,
"instruct": "Given a web search query, retrieve relevant passages that answer the query."
}'| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Content-Type | Header | string | 是 | - | application/json |
Accept | Header | string | 是 | - | application/json |
Authorization | Header | string | 否 | - | Bearer {{YOUR_API_KEY}} |
X-Forwarded-Host | Header | string | 否 | - | localhost:5173 |
model | JSON body | string | 是 | - | - |
documents | JSON body | array<string> | 是 | - | - |
query | JSON body | string | 是 | - | - |
top_n | JSON body | integer | 是 | - | - |
instruct | JSON body | string | 是 | - | - |
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
id | 响应 JSON | string | 是 | - | - |
object | 响应 JSON | string | 是 | - | - |
created | 响应 JSON | integer | 是 | - | - |
choices | 响应 JSON | array<object> | 是 | - | - |
choices[].index | 响应 JSON | integer | 否 | - | - |
choices[].message | 响应 JSON | object | 否 | - | - |
choices[].message.role | 响应 JSON | string | 是 | - | - |
choices[].message.content | 响应 JSON | string | 是 | - | - |
choices[].finish_reason | 响应 JSON | string | 否 | - | - |
usage | 响应 JSON | object | 是 | - | - |
usage.prompt_tokens | 响应 JSON | integer | 是 | - | - |
usage.completion_tokens | 响应 JSON | integer | 是 | - | - |
usage.total_tokens | 响应 JSON | integer | 是 | - | - |
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nHello there, how may I assist you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 497676101,
"name": "重排序",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "给定一个提示,该模型将返回一个或多个预测的完成,并且还可以返回每个位置的替代标记的概率。\n\n为提供的提示和参数创建完成\n\n官方文档:https://docs.siliconflow.cn/cn/api-reference/rerank/create-rerank",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/v1/rerank",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"model": {
"type": "string"
},
"documents": {
"type": "array",
"items": {
"type": "string"
}
},
"query": {
"type": "string"
},
"top_n": {
"type": "integer"
},
"instruct": {
"type": "string"
}
},
"required": [
"model",
"documents",
"query",
"top_n",
"instruct"
],
"x-apifox-orders": [
"model",
"documents",
"query",
"top_n",
"instruct"
]
},
"examples": [
{
"value": " {\n \"model\": \"qwen3-rerank\",\n \"documents\": [\n \"文本排序模型广泛用于搜索引擎 and 推荐系统中,它们根据文本相关性对候选文本进行排序\",\n \"量子计算是计算科学的一个前沿领域\",\n \"预训练语言模型的发展给文本排序模型带来了新的进展\"\n ],\n \"query\": \"什么是文本排序模型\",\n \"top_n\": 2,\n \"instruct\": \"Given a web search query, retrieve relevant passages that answer the query.\"\n}",
"mediaType": "application/json"
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "NQs7bxnpZf",
"name": "Content-Type",
"required": true,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "application/json"
},
{
"id": "qb8tEQbCty",
"name": "Accept",
"required": true,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "application/json"
},
{
"id": "gBxcCbXhsa",
"name": "Authorization",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "Bearer {{YOUR_API_KEY}}"
},
{
"id": "t8P0euDZvz",
"name": "X-Forwarded-Host",
"required": false,
"enable": false,
"description": "",
"type": "string",
"sampleValue": "localhost:5173"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {},
"responses": [
{
"id": 145499000,
"name": "OK",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string"
},
"created": {
"type": "integer"
},
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"message": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"role",
"content"
],
"x-apifox-orders": [
"role",
"content"
]
},
"finish_reason": {
"type": "string"
}
},
"x-apifox-orders": [
"index",
"message",
"finish_reason"
]
}
},
"usage": {
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer"
},
"completion_tokens": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
}
},
"required": [
"prompt_tokens",
"completion_tokens",
"total_tokens"
],
"x-apifox-orders": [
"prompt_tokens",
"completion_tokens",
"total_tokens"
]
}
},
"required": [
"id",
"object",
"created",
"choices",
"usage"
],
"x-apifox-orders": [
"id",
"object",
"created",
"choices",
"usage"
]
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [
{
"name": "OK",
"responseId": 145499000,
"data": "{\n \"id\": \"chatcmpl-123\",\n \"object\": \"chat.completion\",\n \"created\": 1677652288,\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"\\n\\nHello there, how may I assist you today?\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 9,\n \"completion_tokens\": 12,\n \"total_tokens\": 21\n }\n}",
"description": "",
"oasKey": "",
"oasExtensions": "",
"id": "019fd273-07ee-7028-857b-8208d7ae45c5"
},
{
"name": "成功示例",
"responseId": 145499000,
"data": "{\r\n \"results\": [\r\n {\r\n \"document\": {\r\n \"text\": \"文本排序模型广泛用于搜索引擎 and 推荐系统中,它们根据文本相关性对候选文本进行排序\"\r\n },\r\n \"index\": 0,\r\n \"relevance_score\": 0.915543128021105\r\n },\r\n {\r\n \"document\": {\r\n \"text\": \"预训练语言模型的发展给文本排序模型带来了新的进展\"\r\n },\r\n \"index\": 2,\r\n \"relevance_score\": 0.7576691095659295\r\n }\r\n ],\r\n \"usage\": {\r\n \"prompt_tokens\": 107,\r\n \"completion_tokens\": 0,\r\n \"total_tokens\": 107,\r\n \"prompt_tokens_details\": {\r\n \"cached_tokens\": 0,\r\n \"text_tokens\": 0,\r\n \"audio_tokens\": 0,\r\n \"image_tokens\": 0\r\n },\r\n \"completion_tokens_details\": {\r\n \"text_tokens\": 0,\r\n \"audio_tokens\": 0,\r\n \"reasoning_tokens\": 0\r\n },\r\n \"input_tokens\": 0,\r\n \"output_tokens\": 0,\r\n \"input_tokens_details\": null\r\n }\r\n}",
"description": "",
"oasKey": "",
"oasExtensions": "",
"id": "019fd273-07ee-7028-857b-85790cbed8d3"
}
],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92749346,
"ordering": 0,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {},
"isDefaultUrlEncoding": 1
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-05T15:03:02.000Z",
"updatedAt": "2026-08-06T12:15:55.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}