Usage > V2 > Cohere-compatible
Create rerankings
This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score.<br> It is intended to be Cohere-compliant, see their documentation: Cohere: Rerank API (v2).<br> The main discrepancy with the Cohere standard is on consumptions data: while the Cohere standard is to return the object meta, this endpoint returns an object usage that is closer to OpenAI endpoints, especially the embedding one.
post/2/ai/{product_id}/cohere/v2/rerank
Path parameters
product_idinteger required
AI Tools product identifier: use GET /1/ai to retrieve your product identifier.
Request body
Example request
{
"documents": [
"Osmium is the densest metal."
],
"model": "BAAI/bge-reranker-v2-m3",
"query": "Osmium, Iridium and Platinum are the 3 densest metals."
}Response
OK
Example response
{
"id": "rerank-a5dca720-5abc-4331-a8cf-1655693a27e1",
"model": "BAAI/bge-reranker-v2-m3",
"results": [
{
"index": 42,
"document": {
"text": "Silver is the metal with the highest electrical and thermal conductivity.",
"multi_modal": "null"
},
"relevance_score": 0.57721566490153
}
]
}Changes
No recorded changes to this endpoint across all 1 revision of this API.