rerank
Method: POSTEndpoint: /v1/rerank
Request Parameters
Header Parameters
text
Content-Type
string
Required
Example:
application/json
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}Body Parameters application/json
text
model
string
Optional
query
string
Optional
top_n
integer
Optional
documents
array
[string]
Optional
Example
{
"model"
:
"string"
,
"query"
:
"string"
,
"top_n"
:
0
,
"documents"
:
[
"string"
]
}Example Request
Shell
bash
curl --location --request POST '/v1/rerank' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "string",
"query": "string",
"top_n": 0,
"documents": [
"string"
]
}'Response
🟢 200 Success
Content Type: application/json
Response Schema
text
objectExample
json
{
"results": [
{
"document": {
"text": "Organic skincare for sensitive skin with aloe vera and chamomile: Imagine the soothing embrace of nature with our organic skincare range, crafted specifically for sensitive skin. Infused with the calming properties of aloe vera and chamomile, each product provides gentle nourishment and protection. Say goodbye to irritation and hello to a glowing, healthy complexion."
},
"index": 0,
"relevance_score": 0.8783142566680908
},
{
"document": {
// provider-specific example normalized for English documentation
},
"index": 6,
"relevance_score": 0.8783142566680908
},
{
"document": {
"text": "Cuidado de la piel orgánico para piel sensible con aloe vera y manzanilla: Descubre el poder de la naturaleza con nuestra línea de cuidado de la piel orgánico, diseñada especialmente para pieles sensibles. Enriquecidos con aloe vera y manzanilla, estos productos ofrecen una hidratación y protección suave. Despídete de las irritaciones y saluda a una piel radiante y saludable."
},
"index": 4,
"relevance_score": 0.8624675869941711
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 815,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
}
}