POST
/
paas
/
v4
/
rerank
文本重排序
curl --request POST \
  --url https://open.bigmodel.cn/api/paas/v4/rerank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "rerank",
  "query": "查询候选文本A",
  "documents": [
    "需要打分的候选文本A",
    "需要打分的候选文本B"
  ]
}'
{
  "created": 1732083164,
  "id": "20241120141244890ab4ee4af84acf",
  "request_id": "1111111111",
  "results": [
    {
      "document": "Washington, D.C. is the capital of the United States.",
      "index": 1,
      "relevance_score": 0.99866986
    }
  ],
  "usage": {
    "prompt_tokens": 72,
    "total_tokens": 72
  }
}

Authorizations

Authorization
string
header
required

使用以下格式进行身份验证:Bearer <your api key>

Body

application/json

Response

200
application/json

业务处理成功

The response is of type object.