Rerank documents by semantic relevance to a query using qwen3-rerank. Uses a nested request structure with
Parameter definitions:
input and parameters wrappers.
Before you begin: get an API key, set it as an environment variable, and install the DashScope SDK if you use the SDK.
Endpoint
- HTTP:
POST https://dashscope-intl.aliyuncs.com/api/v1/services/rerank/text-rerank/text-rerank - SDK
base_http_api_url:https://dashscope-intl.aliyuncs.com/api/v1
Model overview
| Model | Max Documents | Max Tokens/Doc | Max Request Tokens | Languages | Price (per 1M tokens) | Free Quota | Use Cases |
|---|---|---|---|---|---|---|---|
| qwen3-rerank | 500 | 4,000 | 120,000 | 100+ languages | $0.1 | 1M tokens (valid for 90 days) | Text semantic search, RAG |
- Max Tokens/Doc: Maximum token count per query or document. Content exceeding this limit is truncated, which may affect ranking accuracy.
- Max Documents: Maximum number of documents per request.
- Max Request Tokens: Calculated as
Query Tokens x Document Count + Total Document Tokens. Must not exceed the limit.