Rerank

POST /v1/rerank

The public rerank endpoint currently supports Cohere Rerank 3.5 through Bedrock routing. Requests routed to unsupported upstreams return an error.

Request

terminal
bash
curl -X POST https://api.chuizi.ai/v1/rerank \
  -H "Authorization: Bearer ck-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "cohere/rerank-3.5",
    "query": "What is the capital of France?",
    "documents": [
      "Paris is the capital of France.",
      "Berlin is the capital of Germany."
    ],
    "top_n": 2,
    "return_documents": true
  }'
ParameterRequiredDescription
modelNoDefaults to cohere/rerank-3.5
queryYesQuery text
documentsYesArray of documents to rank
top_nNoReturn the top N results; defaults to all
return_documentsNoDefaults to true

Response

config.json
json
{
  "id": "gen-xxxxxxxxxxxxxxxxxxxxxxxx",
  "model": "cohere/rerank-3.5",
  "results": [
    {
      "index": 0,
      "relevance_score": 0.9985,
      "document": { "text": "Paris is the capital of France." }
    }
  ]
}
Rerank — Chuizi AI Docs | Chuizi AI