Scaleway logo
OpenAI Compatible API

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

POST
https://api.scaleway.ai
/{project_id}/v1/rerank

Identify most relevant documents to answer a query.

Create a reranking › path Parameters

project_id
​ProjectId · required

The 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

query
​string · required

Query requiring relevant documents to provide a better answer.

documents
​string[] · required

Array of document contents in string format. Maximum array items: 1000

model
​string · required

Unique 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_n
​integer

Number of most relevant documents to retrieve.

Create a reranking › Responses

200
id
​integer

UUID of the response.

model
​string

Unique identifier of the model.

​Ranking[]

List of documents sorted by relevance.

​object

Usage information generated by this request.