POST
/
rerank

Authorizations

Api-Key
string
header
required

An API Key is required to call Pinecone APIs. Get yours from the console.

Body

application/json
model
string
required

The model to use for reranking.

query
string
required

The query to rerank documents against.

documents
object[]
required

The documents to rerank.

top_n
integer

The number of results to return sorted by relevance. Defaults to the number of inputs.

return_documents
boolean
default:
true

Whether to return the documents in the response.

rank_fields
string[]

The field(s) to consider for reranking. If not provided, the default is ["text"].

The number of fields supported is model-specific.

parameters
object

Additional model-specific parameters. Refer to the model guide for available model parameters.

Response

200
application/json

The result of a reranking request.

model
string
required

The model used to rerank documents.

data
object[]
required

The reranked documents.

usage
object
required

Usage statistics for the model inference.