Skip to main content
POST
Rerank documents

Rerank models

Rerank models are not returned by GET /v1/models or GET /v1/models/public. These ids work today: cohere/rerank-v3.5, cohere/rerank-4-fast, cohere/rerank-4-pro, voyageai/rerank-2.5, voyageai/rerank-2.5-lite, and qwen/qwen3-reranker-8b.

Authorizations

Authorization
string
header
required

The workspace API key (pdk_…) from Integrations → Built-in in the pre.dev dashboard.

Headers

x-predev-project-id
string

Attribute this call to one of the workspace's projects. An id the workspace does not own is ignored.

Body

application/json
model
string
required

A rerank model id. GET /v1/models and GET /v1/models/public do not list rerank models; these work today: cohere/rerank-v3.5, cohere/rerank-4-fast, cohere/rerank-4-pro, voyageai/rerank-2.5, voyageai/rerank-2.5-lite, qwen/qwen3-reranker-8b.

Example:

"cohere/rerank-v3.5"

query
string
required
documents
(string | object)[]
required
Minimum array length: 1
top_n
integer

Return only the most relevant documents.

Required range: x >= 1

Response

Results sorted by relevance.

model
string
required
results
object[]
required

Sorted by relevance, most relevant first.

id
string
usage
object