Inference APIs
Models/Rerank/Qwen3 Reranker 8B
RerankMultilingual32K input
Max input
32K tokens
Modality
Query + Texts → Scores
Price
$0.07 / 1M input tokens
Model ID
Qwen/Qwen3-Reranker-8B

Quickstart

You need an API key to call this model. Create a free account or log in.

Set INFERENCE_API_KEY to your key from the API Keys page, then run:

curl https://api.inferenceapis.com/v1/rerank \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-Reranker-8B",
    "query": "What is the capital of France?",
    "documents": ["Bananas are yellow.", "Paris is the capital of France.", "Berlin is in Germany."],
    "top_n": 2
  }'
import os, requests

resp = requests.post(
    "https://api.inferenceapis.com/v1/rerank",
    headers={"Authorization": f"Bearer {os.environ['INFERENCE_API_KEY']}"},
    json={
        "model": "Qwen/Qwen3-Reranker-8B",
        "query": "What is the capital of France?",
        "documents": ["Bananas are yellow.", "Paris is the capital of France.", "Berlin is in Germany."],
        "top_n": 2,
    },
    timeout=60,
)
for r in resp.json()["results"]:
    print(r["index"], round(r["relevance_score"], 4))
const resp = await fetch("https://api.inferenceapis.com/v1/rerank", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.INFERENCE_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    model: "Qwen/Qwen3-Reranker-8B",
    query: "What is the capital of France?",
    documents: ["Bananas are yellow.", "Paris is the capital of France.", "Berlin is in Germany."],
    top_n: 2,
  }),
});
console.log((await resp.json()).results);

When to use it

A good fit when
  • Second-stage ranking in RAG: fetch 20 to 100 candidates with embeddings, then keep the best few
Look elsewhere when
  • First-stage retrieval over a whole corpus; that is what embeddings are for

What it costs in practice

WorkloadCost
10,000 searches, each reranking 20 passages of 200 tokens$2.80
1 million searches, each reranking 20 passages of 200 tokens$280
10,000 searches, each reranking 100 passages of 200 tokens$14.00

Computed from the live rate below. There is no subscription or minimum; new accounts start with free credit.

Endpoint

POST https://api.inferenceapis.com/v1/rerank
Headers Authorization: Bearer $INFERENCE_API_KEY
Content-Type: application/json
Compatible OpenAI wire format. /openai/v1/… is accepted too, so Groq-style base URLs work with only the host changed.

Model IDs and aliases

Send any of these as model; they all resolve to this model and bill at its rate.

IDNote
Qwen/Qwen3-Reranker-8BCanonical
qwen3-reranker-8bAlias

Request body

ParameterTypeDescription
model required string Model ID: Qwen/Qwen3-Reranker-8B
query required string The search query.
documents required array Up to 1,000 candidate texts, as strings or {"text": "..."} objects.
top_n integer Return only the best n results. Default: all, sorted by score.
return_documents boolean Include each document's text in the results.

Response

200 OK · application/json
{
  "object": "list",
  "model": "Qwen/Qwen3-Reranker-8B",
  "results": [
    { "index": 1, "relevance_score": 0.978 },
    { "index": 2, "relevance_score": 0.00002 }
  ],
  "usage": { "total_tokens": 251 }
}

Pricing

Price$0.07 / 1M input tokens
BillingPay as you go from prepaid credits. No subscription, no daily request or token cap. See all pricing.

Notes

  • Billing counts the tokens the model reads: the query is read once per document, plus a short instruction, so a request costs more tokens than the raw text suggests. The response reports the count in usage.total_tokens.

Errors

Errors use the OpenAI envelope: {"error": {"message", "type", "code"}}. 401 missing or invalid key · 402 insufficient_balance · 404 model_not_found · 503 model_unavailable · 502 backend error, safe to retry. Full table with what to retry: API documentation. Errors from other providers: provider error reference.