Amazon Bedrock supports reranking documents using the Amazon Rerank model. Portkey provides a standardized interface for reranking through the unified /v1/rerank endpoint.
Reranking Documents
curl https://api.portkey.ai/v1/rerank \
-H "Content-Type: application/json" \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-d '{
"model": "@bedrock-prod/arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0",
"query": "What is the capital of the United States?",
"documents": [
"Carson City is the capital city of the American state of Nevada.",
"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.",
"Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.",
"Capital punishment (the death penalty) has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states."
],
"top_n": 3
}'
Supported Models
| Model | Model ID |
|---|
| Amazon Rerank | amazon.rerank-v1:0 |
Request Parameters
| Parameter | Type | Required | Description |
|---|
model | string | Yes | The reranking model to use |
query | string | Yes | The query to use for reranking |
documents | array | Yes | List of documents to rerank |
top_n | integer | No | Number of top results to return |
The response follows the unified Portkey rerank response format:
{
"object": "list",
"model": "arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0",
"results": [
{
"index": 2,
"relevance_score": 0.95
},
{
"index": 0,
"relevance_score": 0.45
}
],
"usage": {
"total_tokens": 150
}
}
Last modified on January 15, 2026