Rerank
Returns relevance scores and the original document indexes. Text-only models accept text documents. Image documents support a multimodal reranker and a provider that supports the submitted format.
A query and candidate documents to rerank. Additional provider parameters may be supplied, but unsupported parameters can cause a request to fail or restrict eligible providers.
Choose an available model tagged Rerank.
bge-reranker-v2-m3The query against which documents are scored.
How can I reset my account password?The maximum number of ranked results to return. This does not limit the submitted documents processed by the reranker.
2Request document content in the results. Support and returned document fields depend on the provider.
The provider preference for handling the request.
Provider IDs allowed to process the request, subject to project settings.
["berget","ionos"]Whether to use only providers based and regulated within the EU.
Set to custom to try allowed_providers in the listed order instead of using preference-based routing.
Deprecated. Use quantizations instead. When false, excludes quantized endpoints.
Whether to use only zero-data-retention providers.
Allow automatic model fallback. Project settings may override this value.
Explicit fallback model IDs, tried in order. A nonempty list takes precedence over automatic fallback settings.
Ranked documents and input-token usage.
Request identifier, when supplied by the provider.
Invalid request or a document format unsupported by the selected model or provider.
Internal server error.
curl https://api.cortecs.ai/v1/rerank \
-H "Authorization: Bearer $CORTECS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bge-reranker-v2-m3",
"query": "How can I reset my account password?",
"documents": [
"To change your billing address, open Billing settings and update your payment details.",
"To reset your password, select Forgot password on the login page and follow the emailed reset link.",
"To update your profile picture, open Profile settings and upload a new image."
],
"top_n": 2
}'
{
"id": "rerank-example",
"results": [
{
"index": 1,
"relevance_score": 0.69482421875,
"document": {
"text": "To reset your password, select Forgot password on the login page and follow the emailed reset link."
}
},
{
"index": 2,
"relevance_score": 0.000019252300262451172,
"document": {
"text": "To update your profile picture, open Profile settings and upload a new image."
}
}
],
"usage": {
"prompt_tokens": 91,
"completion_tokens": 0,
"total_tokens": 91,
"cost": 10
}
}Last updated