Rerank documents by semantic relevance to a query using qwen3-rerank (text) or qwen3-vl-rerank (text, images, and videos). Uses a nested request structure with
The following uses the Singapore (ap-southeast-1) endpoint. To use China North 2 (Beijing), replace ap-southeast-1 with cn-beijing and use an API key from that region. Reranking is not available in other regions. See Regions and endpoints.
For pricing, see the Model Marketplace.
Parameter definitions:
input and parameters wrappers.
The gte-rerank model was discontinued on May 30, 2026. Switch to qwen3-rerank. This does not apply to
gte-rerank-v2, which remains available in China North 2 (Beijing).Before you begin: get an API key, set it as an environment variable, and install the DashScope SDK if you use the SDK.
Endpoint
The following uses the Singapore (ap-southeast-1) endpoint. To use China North 2 (Beijing), replace ap-southeast-1 with cn-beijing and use an API key from that region. Reranking is not available in other regions. See Regions and endpoints.
- HTTP:
POST https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/rerank/text-rerank/text-rerank - SDK
base_http_api_url:https://ap-southeast-1.maas.qwencloudapi.com/api/v1
Model overview
| Model | Regions | Max Documents | Max Tokens/Doc | Max Request Tokens | Languages | Use Cases |
|---|---|---|---|---|---|---|
| qwen3-rerank | Singapore, China North 2 (Beijing) | 500 | 4,000 | 120,000 | 100+ languages | Text semantic search, RAG |
| gte-rerank-v2 | China North 2 (Beijing) only | 500 | 4,000 | 30,000 | 50+ languages | Text semantic search, RAG |
| qwen3-vl-rerank | China North 2 (Beijing) only | Text: 100; image: 40; video: 4 | 8,000 | 120,000 | 33 languages | Multimodal search result reranking (text, image, video) |
- Max Tokens/Doc: Maximum token count per query or document. If a query or document exceeds this limit, the API returns an HTTP 400 error and does not truncate the input.
- Max Documents: Maximum number of documents per request. For
qwen3-vl-rerank, the limit depends on the document modalities in the request. - Max Request Tokens: Calculated as
Query Tokens x Document Count + Total Document Tokens. Must not exceed the limit.
Body
application/jsonenum<string>
required
Model name. qwen3-rerank and gte-rerank-v2 rerank text. qwen3-vl-rerank reranks text, images, and videos. gte-rerank-v2 and qwen3-vl-rerank are available only in China North 2 (Beijing).
qwen3-rerank,gte-rerank-v2,qwen3-vl-rerank
qwen3-rerank
object
required
Input data containing the query and documents to rank.
object
Parameters for the reranking request. Must be wrapped inside this parameters object.