Skip to main content
POST
/
v1
/
rerank
cURL
curl --request POST \
  --url https://proxy.innk.cc/v1/rerank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "query": "<string>",
  "documents": [
    "<string>"
  ],
  "top_n": 123,
  "return_documents": true,
  "max_chunk_per_doc": 123,
  "overlap_tokens": 79
}
'
{
  "id": "<string>",
  "results": [
    {
      "document": {
        "text": "<string>"
      },
      "index": 123,
      "relevance_score": 123
    }
  ],
  "tokens": {
    "input_tokens": 123,
    "output_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

The authentication header format is Bearer <API_KEY>, where <API_KEY> is your API token.

Body

application/json
model
string
required

Corresponding model name. In order to improve service quality, we will regularly adjust the models provided by this service, including but not limited to model online/offline and adjustments to model service functions. We will try our best to notify you of such changes through appropriate means such as announcements or push messages.

query
string
required

search query

documents
string[]
required

Currently only string lists are supported. Document objects will be supported in the future.

Minimum array length: 1
top_n
integer

The number of most relevant documents or indexes to return.

return_documents
boolean

If false, the response does not contain the document text; if true, the response contains the input document text.

max_chunk_per_doc
integer

The maximum number of data blocks generated in the document. Long documents will be divided into multiple data blocks for calculation, and the data block with the highest score will be used as the final score of the document.

overlap_tokens
integer

The amount of markup overlap between adjacent chunks when the document is chunked.

Required range: x <= 80

Response

200 - application/json

Rerank response

id
string
required
results
object[]
required
tokens
object
required