Skip to main content
Bedrock supports document reranking through Cohere models. Portkey provides a unified /rerank endpoint to access this capability.
For Bedrock providers, pass the complete ARN along with the model name in the model field to make a successful request.Example: arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0

Rerank documents

curl --location 'https://api.portkey.ai/v1/rerank' \
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
--header 'x-portkey-provider: @BEDROCK_PROVIDER_SLUG' \
--header 'Content-Type: application/json' \
--data '{
    "model": "arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0",
    "query": "What is the capital of the United States?",
    "top_n": 3,
    "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.",
        "Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.",
        "Capital punishment has existed in the United States since before the United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states."
    ]
}'
Replace the region in the ARN (e.g., us-east-1) with the region where your Bedrock provider is configured.

AWS Bedrock Rerank Docs

Official AWS documentation for reranking with Amazon Bedrock reranker models.
Last modified on March 23, 2026