Skip to main content
POST
Rerank documents
See the rerank guide for examples, model selection, and billing behavior.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Body

application/json
documents
string[]
required
model
string
required
query
string
required
return_documents
boolean
top_k
integer

Compatibility alias for top_n. Zero means unspecified. Positive values must match top_n when both are supplied.

Required range: x >= 0
top_n
integer

Maximum number of results. Omit to return all documents.

Required range: x >= 1

Response

Successful response

id
string
required
model
string
required
results
object[]
required
usage
object
required