Rerank
Rerank documents by relevance to a query.
Rerank documents by relevance to a query.
Reranking model identifier.
rerank-v3.5Query used to rank the documents.
Maximum number of results to return.
Whether to include document text in the results.
falseMaximum number of tokens per document. Supported by Cohere.
Provider request-priority hint. Supported by Cohere.
Object fields used for ranking. Supported by Pinecone.
Whether to truncate oversized documents. Supported by Voyage.
Represents a reranking response returned by the selected model.
Request identifier.
Response object type.
listThe reranking model used.
Provider that handled the request.
Invalid request data.
The company has run out of AI credits. Returned when the company's budget limit has been reached.
Server error.
POST /v1/rerank HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 223
{
"model": "rerank-v3.5",
"query": "text",
"documents": [
"text"
],
"top_n": 1,
"return_documents": false,
"max_tokens_per_doc": 1,
"priority": 1,
"rank_fields": [
"text"
],
"truncation": true,
"parameters": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}{
"id": "text",
"object": "list",
"model": "text",
"provider": "text",
"results": [
{
"index": 1,
"relevance_score": 1,
"document": {
"text": "text",
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
],
"meta": {
"billed_units": {
"search_units": 1
},
"api_version": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"usage": {
"billed_units": {
"search_units": 1
},
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"cache_write_tokens": 1
},
"nexos_credits_cost": 0.000016,
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}Last updated

