Skip to main content
POST
Submit a rerank request

Authorizations

Authorization
string
header
required

A Nemonist key (sk-nm-...) as a bearer token in the Authorization header.

Headers

HTTP-Referer
string

The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application.

X-OpenRouter-Title
string

The app display name allows you to customize how your app appears in OpenRouter's dashboard.

X-OpenRouter-Categories
string

Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.

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 this request.

Example:
session_id
string

A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.

Maximum string length: 256
Example:

"session-1234"

top_n
integer

Number of most relevant documents to return

Required range: x >= 1
Example:

3

trace
object

Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.

Example:
user
string

A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.

Maximum string length: 256
Example:

"user-1234"

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: