Skip to main content
POST
Submit a rerank request

Authorizations

Authorization
string
header
required

API key as bearer token in Authorization header

Body

application/json

Rerank request input

documents
(string | object)[]
required

The list of documents to rerank. Documents may be plain strings, or structured objects with text and/or image for multimodal models.

Minimum array length: 1

A document to rerank. Either a plain string, or a structured object with optional text and/or image.

Example:
model
string
required

The rerank model to use

Example:

"cohere/rerank-v3.5"

query
string
required

The search query to rerank documents against

Example:

"What is the capital of France?"

provider
object | null

Provider routing preferences for the request.

Example:
top_n
integer

Number of most relevant documents to return

Required range: x >= 1
Example:

3

Response

Rerank response

Rerank response containing ranked results

model
string
required

The model used for reranking

Example:

"cohere/rerank-v3.5"

results
object[]
required

List of rerank results sorted by relevance

Example:
id
string

Unique identifier for the rerank response (ORID format)

Example:

"gen-rerank-1234567890-abc"

provider
string

The provider that served the rerank request

Example:

"Cohere"

usage
object

Usage statistics

Example: