A ranking is an ordering of documents by relevance, based on a query.
See How to query reranking modelsOpen in new context
for code snippets using openai Python client.
Create a reranking
Identify most relevant documents to answer a query.
path Parameters
project_idThe ID of the Project you want to target. If this value is not provided, your default Project will be used.
Specifying this value allows you to limit access through IAM policies, or to allocate consumption and billing to a specific project.
Create a reranking › Request Body
queryQuery requiring relevant documents to provide a better answer.
documentsArray of document contents in string format.
Maximum array items: 1000
modelUnique identifier of the model, such as qwen3-embedding-8b.
Refer to our supported modelsOpen in new context list or /models endpoint for available models.
top_nNumber of most relevant documents to retrieve.
Create a reranking › Responses
idUUID of the response.
modelUnique identifier of the model.
List of documents sorted by relevance.
Usage information generated by this request.