> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixroute.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Rerank v4.0 Pro

> Cohere 注重排序質量的多語言相關性重排序模型。

Cohere 注重排序質量的多語言相關性重排序模型。

## 模型資訊

| 欄位         | 說明              |
| ---------- | --------------- |
| `model`    | rerank-v4.0-pro |
| `context`  | 32,768 tokens   |
| `endpoint` | POST /v1/rerank |

上下文和輸出長度為模型規格；實際請求限制、可用性與計費取決於 MixRoute 路由。

## 能力與使用

* 根據 query 對候選 documents 進行排序，不生成回答或向量。
* 上下文限制針對查詢與單篇文件的組合。先召回候選文件，再通過 top\_n 選出最相關結果。
* results\[].index 對應原始 documents 陣列的位置，應使用該索引取回文件，而不是假設響應始終包含原文。

## 請求示例

呼叫前設定 `MIXROUTE_API_KEY`。

```bash theme={null}
curl --request POST "https://api.mixroute.ai/v1/rerank" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "rerank-v4.0-pro",
  "query": "API documentation",
  "documents": [
    "An API reference for developers.",
    "A recipe for soup."
  ],
  "top_n": 1
}'
```

## 請求欄位

| 欄位          | 說明                 |
| ----------- | ------------------ |
| `model`     | 必填，使用上方完整模型 ID。    |
| `query`     | 必填，查詢文本。           |
| `documents` | 必填，候選文件字串陣列。       |
| `top_n`     | 可選，返回條數，不超過候選文件數量。 |

完整請求格式見[介面說明](/zh-hant/api-reference/endpoint/rerank)。
