POST
/
rerank
curl --request POST \
  --url https://api.contextual.ai/v1/rerank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "<string>",
  "documents": [
    "<string>"
  ],
  "model": "<string>",
  "top_n": 123,
  "instruction": "<string>",
  "metadata": [
    "<string>"
  ]
}'
{
  "results": [
    {
      "index": 123,
      "relevance_score": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Rerank input request object.

Response

200
application/json

Successful Response

Rerank output response.