Skip to main content
A reranker reads a query and a list of texts and scores how relevant each text is to the query. Use it after a first retrieval step, such as embeddings or keyword search, to put the best passages first before you hand them to an LLM. The request and the response follow the Cohere v2 rerank API, so a client written for POST /v2/rerank works against Eden AI by changing the base URL and the model id.

Endpoints

Both use the same Authorization: Bearer YOUR_API_KEY header as the rest of the API. Models are identified as provider/model, for example vertex/semantic-ranker-default-004. The V2 API has no rerank route. This is the only rerank API Eden AI offers.

List rerank models

GET /v3/rerank/models lists the models that can serve a rerank call. It takes the same view and zero_data_retention parameters as the other model listings, and each entry carries zero_data_retention, which says whether the provider keeps your inputs after the response. Only models that are in this list can be called, by their provider/model id. With view=models the entries are grouped under a model name that rerank does not accept: call one of the nested endpoints[].id values instead. Rerank lists no routing policy.

Rank documents

Request fields

fallbacks is refused with 400. Any other top-level field is forwarded to the provider. Fields that decide the provider connection, the region, or how the call is made, priced or answered, such as api_key, api_base or base_url, are refused with 422.

Response

Providers

Rerank is served by Google Vertex, Amazon Bedrock, DeepInfra, Fireworks, Qwen, GreenPT, IONOS and Infomaniak. The models you can call are the ones GET /v3/rerank/models returns; a provider appearing in this list does not mean every one of its models is offered. Amazon Bedrock serves rerankers in fewer regions than chat models. When the region chosen for a call has no reranker, the call runs in the nearest region that has one: us-east-1 moves to us-west-2 and eu-west-1 moves to eu-central-1 for amazon.rerank-v1:0. For how each provider handles your data, see Provider data policies.

Billing

A model is priced either per search unit or per token, never both. A model whose pricing row sets both rates, or neither, cannot be called. The unit and its rate are in the pricing of the model’s entry in GET /v3/rerank/models. GreenPT, IONOS and Infomaniak bill in the unit their pricing row names. Amazon Bedrock reports no usage, so Eden AI counts the search units from your request with the same chunk rule. Eden AI estimates the cost before the call, holds that amount, and charges the actual cost when the call returns. For a per-token model the estimate reads the query once per document, plus the document tokens and a fixed allowance per query and document pair for the reranker’s prompt template. For a per-search model it is the number of search units the chunk rule gives. When a provider reports no billable count, or reports zero, the call is charged at the estimate made before the call, never at zero. The response cost then holds that amount.

Regions, guardrails and tags

  • Regions. provider/model@region is accepted when the model lists that region in GET /v3/rerank/models. A region the model does not offer answers 400, and a region that contradicts the regional endpoint you called answers 451.
  • Guardrails. Your organization’s guardrail model rules apply, and a model they do not allow answers 403.
  • Tags. The tags field and the X-EdenAI-Tags header both apply.

What rerank does not support

  • Model routing. @edenai is refused with 400. Name a rerank model directly, for example vertex/semantic-ranker-default-004.
  • Model names without a provider. semantic-ranker-default-004 answers 400. Name it as provider/model, for example vertex/semantic-ranker-default-004.
  • Models that are not rerank models. A chat model such as openai/gpt-5 answers 400 before any provider is called.
  • Fallbacks. fallbacks answers 400. Send one model per request.
  • Routing preferences other than zero data retention. With a named provider/model there is no provider to choose, so sort, order, allowed_providers, ignored_providers and max_price have no effect.
  • Routing policies. A key’s default routing policy does not apply, and policy/{name} is not a rerank model.
  • Non-text documents. documents is a list of strings. Send the text of each passage; images and structured objects are refused with 422.
  • More than 1,000 documents or an empty list. Both answer 422.

Errors