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 }'
| Parameter | Required | Description |
|---|---|---|
model | No | Defaults to cohere/rerank-3.5 |
query | Yes | Query text |
documents | Yes | Array of documents to rank |
top_n | No | Return the top N results; defaults to all |
return_documents | No | Defaults 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." } } ] }