> For AI agents: the complete documentation index is available at https://little-butterfly-9bfe.sentia389.workers.dev/llms.txt, the full documentation bundle is available at https://little-butterfly-9bfe.sentia389.workers.dev/llms-full.txt.

# Moonshot Kimi

以下协议以 Kimi API 开放平台的模型推理接口为准。通过 routerlio 调用时，可用入口、字段和上限取决于当前令牌与渠道。

| 型号与调用示例                                                                                               | routerlio 模型 ID | Kimi 官方定位                | Kimi API 官方支持协议                               |
| ----------------------------------------------------------------------------------------------------- | --------------- | ------------------------ | --------------------------------------------- |
| [Kimi K3.1 Pro](https://little-butterfly-9bfe.sentia389.workers.dev/models/moonshot/kimi-k3-1-pro.md) | `kimi-k3.1-pro` | 加强长程编程、空间推理和金融研究，可理解视觉输入 | Chat Completions、Responses、Anthropic Messages |
| [Kimi K3](https://little-butterfly-9bfe.sentia389.workers.dev/models/moonshot/kimi-k3.md)             | `kimi-k3`       | 长程编程、知识工作、深度推理，可理解视觉输入   | Chat Completions、Responses、Anthropic Messages |

新接入可用 K3.1 Pro 的最小示例验证所选协议。已有 K3 集成可用原有任务评估 K3.1 Pro，重点看跨文件修改、多轮工具调用和视觉空间推理。先固定客户端协议和推理档，只换模型 ID，再单独调整推理强度。[Kimi K3.1 Pro 型号指南](https://platform.kimi.com/docs/guide/kimi-k3-1-pro-quickstart)

:::tip 复制与服务匹配的入口和密钥

Kimi 开放平台直连使用 `api.moonshot.cn` 和开放平台 API Key，其中 Messages 的路径为 `/anthropic/v1/messages`，使用 Bearer 鉴权。Kimi Code 使用 `api.kimi.com/coding/`、独立的 Kimi Code API Key 以及 `k3.1-pro`、`k3` 等模型 ID。走 routerlio 时，使用网关根地址、routerlio 令牌和 `/v1/models` 返回的完整 ID，按客户端协议发送请求。[Kimi API 概述](https://platform.kimi.com/docs/api/overview) · [Kimi Messages API](https://platform.kimi.com/docs/api/messages) · [Kimi Code 接入](https://www.kimi.com/code/docs/#api-接入) · [routerlio 快速接入](https://little-butterfly-9bfe.sentia389.workers.dev/start/index.md#%E9%80%89%E6%8B%A9%E5%8D%8F%E8%AE%AE)

:::

| 两个型号的官方参数               | 类型      | Kimi Chat Completions 限制                 |
| ----------------------- | ------- | ---------------------------------------- |
| 上下文窗口                   | token 数 | 100 万 token。输入历史、推理和最终答案需要留出空间。          |
| `reasoning_effort`      | 字符串     | `low`、`high`、`max`，默认 `max`，思考始终开启。      |
| `max_completion_tokens` | 整数      | 输出预算包含推理与正文，默认 131,072，最大可设置为 1,048,576。 |

## 查询令牌可见的型号

把 `ROUTERLIO_BASE_URL` 设为 routerlio 根地址（不含 `/v1`），把 `ROUTERLIO_API_KEY` 设为调用令牌，用同一个令牌查询列表。

```bash
curl \
  --silent \
  --show-error \
  --url "${ROUTERLIO_BASE_URL:?请设置网关根地址}/v1/models" \
  --header "Authorization: Bearer ${ROUTERLIO_API_KEY:?请设置令牌}"
```

列表响应节选（示意）。在 `data[].id` 中找到目标值后，将其设为系列页请求中的 `ROUTERLIO_MODEL`。

```json
{
  "object": "list",
  "data": [
    {
      "id": "kimi-k3.1-pro",
      "object": "model"
    }
  ]
}
```

按现有客户端选择 [Chat Completions](https://little-butterfly-9bfe.sentia389.workers.dev/models/moonshot/kimi-k3-1-pro.md#chat-completions)、[Responses](https://little-butterfly-9bfe.sentia389.workers.dev/models/moonshot/kimi-k3-1-pro.md#responses) 或 [Anthropic Messages](https://little-butterfly-9bfe.sentia389.workers.dev/models/moonshot/kimi-k3-1-pro.md#anthropic-messages) 的请求与响应示例。切换协议时，在[请求参数](https://little-butterfly-9bfe.sentia389.workers.dev/models/moonshot/kimi-k3-1-pro.md#%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0)核对推理强度、输出预算和结构化输出字段。查询或路由失败时见[故障排查](https://little-butterfly-9bfe.sentia389.workers.dev/troubleshooting/index.md)。

## 官方参考

- [Kimi API 模型列表](https://platform.kimi.com/docs/models)
- [Kimi K3.1 Pro 型号指南](https://platform.kimi.com/docs/guide/kimi-k3-1-pro-quickstart)
- [Kimi K3 型号指南](https://platform.kimi.com/docs/guide/kimi-k3-quickstart)
- [Kimi Chat Completions API](https://platform.kimi.com/docs/api/chat)
- [Kimi Responses API](https://platform.kimi.com/docs/api/responses)
- [Kimi Anthropic 兼容 Messages API](https://platform.kimi.com/docs/api/messages)
