Skip to content
API Key:点击 API调用 / APIKEY管理 界面获取,示例:ak-f30b1********fc84b82e86a
Model ID:点击 API调用 获取

1 请求参数 ​

model
string必填
指定要调用的 Rerank 模型 ID,例如 s125c8e0e。
query
string必填
用于排序的查询语句。
documents
array必填
需要进行重排序的文档字符串数组。

2 请求示例 ​

json
{
  "model": "s125c8e0e",
  "query": "夏天最好吃的水果是?",
  "documents": ["西瓜", "草莓", "荔枝"]
}

3 响应 ​

  1. 成功响应示例
json
{
  "id": "xxx",
  "object": "xxxx",
  "created": 1737030836,
  "model": "xop3qwen0b6reranker",
  "results": [
    {
      "index": 0,
      "relevance_score": 0.2704802
    },
    {
      "index": 2,
      "relevance_score": 0.0011695
    },
    {
      "index": 1,
      "relevance_score": 0.0002780
    }
  ],
  "usage": {
    "prompt_tokens": 131,
    "total_tokens": 131
  }
}

注意

results数组中的document字段已在较新版本中移除,仅返回索引和分数。

  1. 响应参数说明
id
string
本次调用的唯一 ID。
object
string
对象类型。
created
int
响应生成的 Unix 时间戳。
model
string
实际调用的模型名称。
results
array
包含排序结果的数组。注意:此数组默认不按分数排序。
index
int
对应原始 documents 数组中的索引。
relevance_score
float
文档与查询的相关性得分。
usage
object
Token 使用统计信息。