Qwen3-Rerank (alibaba/qwen3-rerank) is a rerank model from Alibaba, released 2026-01-27. Context window: — tokens; max output —. Pricing via AIgateway: input $0.100/M tokens, output $0/M tokens. Call it via https://api.aigateway.sh/v1/rerank — set model="alibaba/qwen3-rerank".
curl https://api.aigateway.sh/v1/rerank \
-H "Authorization: Bearer $AIGATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"alibaba/qwen3-rerank","query":"weather","documents":["sun is bright","mars is red"]}'{
"model": "alibaba/qwen3-rerank",
"query": "What is the capital of France?",
"documents": [
"Paris is the capital of France.",
"Berlin is the capital of Germany.",
"The Eiffel Tower is in Paris."
],
"top_n": 3
}{
"model": "alibaba/qwen3-rerank",
"results": [
{ "index": 0, "document": "Paris is the capital of France.", "score": 0.98 },
{ "index": 2, "document": "The Eiffel Tower is in Paris.", "score": 0.71 },
{ "index": 1, "document": "Berlin is the capital of Germany.", "score": 0.04 }
]
}import os, requests
r = requests.post(
"https://api.aigateway.sh/v1/rerank",
headers={"Authorization": f"Bearer {os.environ['AIGATEWAY_API_KEY']}"},
json={
"model": "alibaba/qwen3-rerank",
"query": "What is the capital of France?",
"documents": [
"Paris is the capital of France.",
"Berlin is the capital of Germany."
]
},
)
print(r.json())