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

# Kimi K3.1 Pro

> Moonshot 推理模型，具備 1M token 上下文與原生視覺理解能力，適用於程式設計與智慧代理工作流程。

Kimi K3.1 Pro 在 Kimi K3 基礎上強化程式設計、3D 開發工作流程與研究能力。透過 MixRoute Chat Completions 呼叫時，使用下方完整模型 ID。

## 模型資訊

| 欄位 | 說明 |
| - | - |
| Model ID | `kimi-k3.1-pro` |
| API | `POST /v1/chat/completions` |
| 上下文視窗 | 1M tokens（廠商規格） |

> [!NOTE]
>
> 下方能力與限制依據廠商模型規格；實際可用性、請求限制與價格取決於 MixRoute 路由和模型市集。

## 請求範例

將 `MIXROUTE_API_KEY` 設為你的 MixRoute API Key。範例選擇 `low` 推理強度。

**cURL**

```bash theme={null}
curl "https://api.mixroute.ai/v1/chat/completions" \
  -H "Authorization: Bearer $MIXROUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3.1-pro",
    "messages": [{"role": "user", "content": "Suggest three ways to simplify this application architecture."}],
    "reasoning_effort": "low"
  }'
```

**Python**

```python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MIXROUTE_API_KEY"],
    base_url="https://api.mixroute.ai/v1",
)
response = client.chat.completions.create(
    model="kimi-k3.1-pro",
    messages=[{"role": "user", "content": "Suggest three ways to simplify this application architecture."}],
    reasoning_effort="low",
)
print(response.choices[0].message.content)
```

**Streaming**

```python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MIXROUTE_API_KEY"],
    base_url="https://api.mixroute.ai/v1",
)
stream = client.chat.completions.create(
    model="kimi-k3.1-pro",
    messages=[{"role": "user", "content": "Suggest three ways to simplify this application architecture."}],
    reasoning_effort="low",
    stream=True,
)
for chunk in stream:
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="", flush=True)
```

## 請求欄位

| 參數 | 類型 | 必填 | 說明 |
| - | - | - | - |
| `model` | string | 是 | 使用 `kimi-k3.1-pro`。 |
| `messages` | array | 是 | 包含 `role` 與 `content` 的訊息陣列。 |
| `reasoning_effort` | string | 否 | 可選 `low`、`high`、`max`，預設 `max`；思考始終啟用。 |
| `max_completion_tokens` | integer | 否 | 輸出 token 預算；廠商預設 131072，上限 1048576，同時受上下文與路由限制。 |
| `stream` | boolean | 否 | 設為 `true` 啟用 SSE 串流回應。 |
| `tools` | array | 否 | OpenAI 格式的函式定義。 |
| `tool_choice` | string | 否 | 可選 `auto`、`none`、`required`。 |

## 使用注意

* 省略固定取樣參數：`temperature=1.0`、`top_p=0.95`、`n=1`、`presence_penalty=0`、`frequency_penalty=0`。不要傳入 K2.x 的 `thinking` 參數。
* 多輪對話與工具呼叫時，完整回傳 assistant 訊息，包括 `reasoning_content` 與 `tool_calls`，不要只保留 `content`。
* 圖片輸入的 `content` 應為陣列，在 `image_url` 部分傳入 base64 data URL；廠商不接受公開圖片 URL。上游檔案 ID 不能直接當作 MixRoute 檔案使用。
* 串流回應區分 `reasoning_content` 與最終答案 `content`；串流範例僅列印最終答案。

[Chat Completions 請求格式](https://mixroute.ai/docs/zh-Hant/api-reference/endpoint/chat-openai.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.