Rerank

Create Rerank

Rank documents by relevance to query (Cohere v2 rerank).

post/v3/rerank

Request

  • Base URL
    https://api.edenai.run
  • Auth
    HTTP bearer

Request body

tagsunknown
modelstring required

Model identifier in 'provider/model' format, e.g. 'cohere/rerank-v3.5'.

querystring required

The search query to rank the documents against.

documentsstring[] required

The texts to rank, at most 1000.

top_ninteger nullable

Return only the top_n most relevant results. Defaults to all documents.

return_documentsboolean

Echo each ranked document's text in its result under document.text.

metadataobject nullable

Arbitrary metadata attached to the request.

extra_headersobject nullable

Additional HTTP headers forwarded to the provider API.

Example request

{
  "tags": {
    "client": "acme",
    "project": "invoices"
  }
}

Response

Successful Response

costnumber nullable

Charge in USD from the row's rates; None when it cannot be computed in full (no row, an unusable rate, or no billable count for a priced unit).

providerstring nullable
idstring nullable

Identifier of the rerank call, as the provider returned it.

metaobject nullable

The provider's own billing metadata, as litellm returned it.

Changes

No recorded changes to this operation across all 1 revision of this API.