Rerank results
For guidance and examples, see Rerank results.
POST /rerank
Parameters
Section titled “Parameters”X-Pinecone-Api-Version(header, string, required) — Required date-based version header
Request body
Section titled “Request body”model(body, string, required) — The model to use for reranking.query(body, string, required) — The query to rerank documents against.top_n(body, integer) — The number of results to return sorted by relevance. Defaults to the number of inputs.return_documents(body, boolean) — Whether to return the documents in the response.rank_fields(body, string[]) — The field(s) to consider for reranking. If not provided, the default is["text"]. The number of fields supported is model-specific.documents(body, object[], required) — The documents to rerank.parameters(body, object) — Additional model-specific parameters. Refer to the model guide for available model parameters.
Responses
Section titled “Responses”200— OK400— Bad request. The request body included invalid request parameters.401— Unauthorized. Possible causes: Invalid API key.500— Internal server error.