DocsAPI reference
Rerank and score
POST /v1/rerank and /v1/score — order documents by how well they answer a query with Qwen3-Reranker-8B on your own GPU.
POST https://osarai.xyz/v1/rerank
POST https://osarai.xyz/v1/scoreA reranker reads a query together with each candidate document and scores how well the document answers it. It is slower than embeddings but far more precise, so the usual pattern is: fetch 50–100 candidates with embeddings, then rerank them. Deploy Qwen3-Reranker-8B (qwen3-reranker-8b) to use these endpoints.
Rerank
curl "https://osarai.xyz/v1/rerank" \
-H "Authorization: Bearer $OSARAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-reranker-8b",
"query": "How do I reset my password?",
"documents": [
"Open Settings, choose Security and press Reset password.",
"Our office is closed on public holidays.",
"Passwords must be at least 12 characters long."
],
"top_n": 2
}'| Field | Notes |
|---|---|
model | qwen3-reranker-8b |
query | The search query |
documents | The candidate texts |
top_n | Return only the best N (default: all) |
{
"model": "qwen3-reranker-8b",
"results": [
{ "index": 0, "document": { "text": "Open Settings, choose Security and press Reset password." }, "relevance_score": 0.97 },
{ "index": 2, "document": { "text": "Passwords must be at least 12 characters long." }, "relevance_score": 0.31 }
],
"usage": { "total_tokens": 64 }
}results are sorted best first; index points into your documents. The format matches Jina's and Cohere's rerank APIs, so their clients work with the base URL changed.
Score
/v1/score scores pairs without sorting: one query against many texts, or pairs side by side.
curl "https://osarai.xyz/v1/score" \
-H "Authorization: Bearer $OSARAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-reranker-8b",
"text_1": "How do I reset my password?",
"text_2": ["Open Settings, choose Security and press Reset password.", "Our office is closed on public holidays."]
}'{
"object": "list",
"model": "qwen3-reranker-8b",
"data": [
{ "index": 0, "object": "score", "score": 0.97 },
{ "index": 1, "object": "score", "score": 0.02 }
]
}Scores range from 0 to 1. Request bodies can be up to 8 MiB, and each query–document pair must fit the model's 16K-token window.