> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.empiriolabs.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.empiriolabs.ai/_mcp/server.

# Qwen3 Rerank

> Semantic document reranker. Sorts up to 500 candidates per query by relevance, supports 100+ languages, and accepts a custom sorting instruction.

![Qwen3 Rerank](https://media.empiriolabs.ai/model-logos/qwen.png)

[Alibaba Cloud](/providers/alibaba) · Reranker

`POST /v1/reranks`

Semantic document reranker. Sorts up to 500 candidates per query by relevance, supports 100+ languages, and accepts a custom sorting instruction.

## At a glance

| Field               | Value                                                    |
| ------------------- | -------------------------------------------------------- |
| Model id            | `qwen3-rerank`                                           |
| Model release date  | 2025-06-05                                               |
| Input modalities    | Text                                                     |
| Output modalities   | Ranking                                                  |
| Context window      | 4K                                                       |
| Weight precision    | -                                                        |
| Region              | Singapore                                                |
| Features            | semantic ranking, multilingual, rag, custom instructions |
| Native inference    | No                                                       |
| New                 | No                                                       |
| Supported endpoints | `POST /v1/reranks`                                       |

## Pricing

| Charge | Spec                 | Rate   |
| ------ | -------------------- | ------ |
| Input  | per 1M prompt tokens | \$0.10 |

## Example request

```bash
curl https://api.empiriolabs.ai/v1/reranks \
  -H 'Authorization: Bearer $EMPIRIOLABS_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"model": "qwen3-rerank", "query": "What is a rerank model?", "documents": ["Rerank models sort candidate documents by relevance.", "Quantum computing is a cutting-edge field of computer science.", "Pre-trained language models advanced rerank models."], "top_n": 2, "return_documents": true}'
```

## Parameters

| Parameter          | Type    | Required | Default                                                                         | Description                                                                                   |
| ------------------ | ------- | -------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `query`            | string  | yes      | -                                                                               | Query text to rank documents against. Max 4,000 tokens.                                       |
| `documents`        | array   | yes      | -                                                                               | Candidate documents to sort (strings). Max 500 items, each up to 4,000 tokens.                |
| `top_n`            | number  | no       | `10`                                                                            | Number of top-ranked documents to return. Defaults to all. · Range: 1 – 500                   |
| `instruct`         | string  | no       | `"Given a web search query, retrieve relevant passages that answer the query."` | Custom English instruction. Use "Retrieve semantically similar text." for similarity sorting. |
| `return_documents` | boolean | no       | false                                                                           | When true, return the original document text alongside each result.                           |

## Notes

**Per-request limits**

* Up to 500 candidate documents per request
* Max 4,000 tokens per query/document
* Max 120,000 tokens per request (formula: query\_tokens × n\_docs + sum\_of\_doc\_tokens)
* Tokens billed are query+documents combined; only successful reranks are charged

**Languages**

* 100+ major languages including Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian

**Sorting modes (`instruct` parameter)**

* *Default, Q\&A retrieval*: `Given a web search query, retrieve relevant passages that answer the query.`
* *Semantic similarity*: `Retrieve semantically similar text.`
* Or any custom English instruction (see [model task prompts](https://github.com/QwenLM/Qwen3-Embedding/blob/main/evaluation/task_prompts.json))

---

*Machine-readable schema:* `GET https://api.empiriolabs.ai/v1/models/qwen3-rerank`.