Documentation renewed! For old docs, visit doc.newapi.pro
New APINew API
User GuideInstallationAPI ReferenceAI ApplicationsHelp & SupportBusiness Cooperation
AI Model APIRerank

Document Reranking

Reranks a list of documents by relevance based on a query

POST
/v1/rerank

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

In: header

Request Body

application/json

model*string
query*string

查询文本

documents*

要重排序的文档列表

top_n?integer

返回前 N 个结果

return_documents?boolean
Defaultfalse

Response Body

application/json

curl -X POST "https://api.example.com/v1/rerank" \  -H "Content-Type: application/json" \  -d '{    "model": "rerank-english-v2.0",    "query": "string",    "documents": [      "string"    ]  }'
{
  "id": "string",
  "results": [
    {
      "index": 0,
      "relevance_score": 0,
      "document": {}
    }
  ],
  "meta": {}
}

How is this guide?

Last updated on