feat(moonshot): default to Kimi K2.6 with K2.6-only thinking.keep support (#68816)

Merged via squash.

Prepared head SHA: ed54e02842
Co-authored-by: aniaan <40813941+aniaan@users.noreply.github.com>
Co-authored-by: odysseus0 <8635094+odysseus0@users.noreply.github.com>
Reviewed-by: @odysseus0
This commit is contained in:
aniaan
2026-04-21 09:04:49 +08:00
committed by GitHub
parent a112903802
commit c8e5150fd4
11 changed files with 229 additions and 25 deletions

View File

@@ -431,7 +431,7 @@ See [/providers/kilocode](/providers/kilocode) for setup details.
`input: ["text", "image"]`; the bundled provider catalog keeps the chat refs
text-only until that provider config is materialized
- Moonshot: `moonshot` (`MOONSHOT_API_KEY`)
- Example model: `moonshot/kimi-k2.5`
- Example model: `moonshot/kimi-k2.6`
- Kimi Coding: `kimi` (`KIMI_API_KEY` or `KIMICODE_API_KEY`)
- Example model: `kimi/kimi-code`
- Qianfan: `qianfan` (`QIANFAN_API_KEY`)
@@ -488,13 +488,14 @@ need to override the base URL or model metadata:
- Provider: `moonshot`
- Auth: `MOONSHOT_API_KEY`
- Example model: `moonshot/kimi-k2.5`
- Example model: `moonshot/kimi-k2.6`
- CLI: `openclaw onboard --auth-choice moonshot-api-key` or `openclaw onboard --auth-choice moonshot-api-key-cn`
Kimi K2 model IDs:
[//]: # "moonshot-kimi-k2-model-refs:start"
- `moonshot/kimi-k2.6`
- `moonshot/kimi-k2.5`
- `moonshot/kimi-k2-thinking`
- `moonshot/kimi-k2-thinking-turbo`
@@ -505,7 +506,7 @@ Kimi K2 model IDs:
```json5
{
agents: {
defaults: { model: { primary: "moonshot/kimi-k2.5" } },
defaults: { model: { primary: "moonshot/kimi-k2.6" } },
},
models: {
mode: "merge",
@@ -514,7 +515,7 @@ Kimi K2 model IDs:
baseUrl: "https://api.moonshot.ai/v1",
apiKey: "${MOONSHOT_API_KEY}",
api: "openai-completions",
models: [{ id: "kimi-k2.5", name: "Kimi K2.5" }],
models: [{ id: "kimi-k2.6", name: "Kimi K2.6" }],
},
},
},

View File

@@ -2673,8 +2673,8 @@ Set `ZAI_API_KEY`. `z.ai/*` and `z-ai/*` are accepted aliases. Shortcut: `opencl
env: { MOONSHOT_API_KEY: "sk-..." },
agents: {
defaults: {
model: { primary: "moonshot/kimi-k2.5" },
models: { "moonshot/kimi-k2.5": { alias: "Kimi K2.5" } },
model: { primary: "moonshot/kimi-k2.6" },
models: { "moonshot/kimi-k2.6": { alias: "Kimi K2.6" } },
},
},
models: {
@@ -2686,8 +2686,8 @@ Set `ZAI_API_KEY`. `z.ai/*` and `z-ai/*` are accepted aliases. Shortcut: `opencl
api: "openai-completions",
models: [
{
id: "kimi-k2.5",
name: "Kimi K2.5",
id: "kimi-k2.6",
name: "Kimi K2.6",
reasoning: false,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

View File

@@ -10,7 +10,7 @@ title: "Moonshot AI"
# Moonshot AI (Kimi)
Moonshot provides the Kimi API with OpenAI-compatible endpoints. Configure the
provider and set the default model to `moonshot/kimi-k2.5`, or use
provider and set the default model to `moonshot/kimi-k2.6`, or use
Kimi Coding with `kimi/kimi-code`.
<Warning>
@@ -23,6 +23,7 @@ Moonshot and Kimi Coding are **separate providers**. Keys are not interchangeabl
| Model ref | Name | Reasoning | Input | Context | Max output |
| --------------------------------- | ---------------------- | --------- | ----------- | ------- | ---------- |
| `moonshot/kimi-k2.6` | Kimi K2.6 | No | text, image | 262,144 | 262,144 |
| `moonshot/kimi-k2.5` | Kimi K2.5 | No | text, image | 262,144 | 262,144 |
| `moonshot/kimi-k2-thinking` | Kimi K2 Thinking | Yes | text | 262,144 | 262,144 |
| `moonshot/kimi-k2-thinking-turbo` | Kimi K2 Thinking Turbo | Yes | text | 262,144 | 262,144 |
@@ -61,7 +62,7 @@ Choose your provider and follow the setup steps.
{
agents: {
defaults: {
model: { primary: "moonshot/kimi-k2.5" },
model: { primary: "moonshot/kimi-k2.6" },
},
},
}
@@ -81,9 +82,10 @@ Choose your provider and follow the setup steps.
env: { MOONSHOT_API_KEY: "sk-..." },
agents: {
defaults: {
model: { primary: "moonshot/kimi-k2.5" },
model: { primary: "moonshot/kimi-k2.6" },
models: {
// moonshot-kimi-k2-aliases:start
"moonshot/kimi-k2.6": { alias: "Kimi K2.6" },
"moonshot/kimi-k2.5": { alias: "Kimi K2.5" },
"moonshot/kimi-k2-thinking": { alias: "Kimi K2 Thinking" },
"moonshot/kimi-k2-thinking-turbo": { alias: "Kimi K2 Thinking Turbo" },
@@ -101,6 +103,15 @@ Choose your provider and follow the setup steps.
api: "openai-completions",
models: [
// moonshot-kimi-k2-models:start
{
id: "kimi-k2.6",
name: "Kimi K2.6",
reasoning: false,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 262144,
maxTokens: 262144,
},
{
id: "kimi-k2.5",
name: "Kimi K2.5",
@@ -218,7 +229,7 @@ search.
| Setting | Options |
| ------------------- | -------------------------------------------------------------------- |
| API region | `https://api.moonshot.ai/v1` (international) or `https://api.moonshot.cn/v1` (China) |
| Web search model | Defaults to `kimi-k2.5` |
| Web search model | Defaults to `kimi-k2.6` |
</Step>
</Steps>
@@ -234,7 +245,7 @@ Config lives under `plugins.entries.moonshot.config.webSearch`:
webSearch: {
apiKey: "sk-...", // or use KIMI_API_KEY / MOONSHOT_API_KEY
baseUrl: "https://api.moonshot.ai/v1",
model: "kimi-k2.5",
model: "kimi-k2.6",
},
},
},
@@ -266,7 +277,7 @@ Config lives under `plugins.entries.moonshot.config.webSearch`:
agents: {
defaults: {
models: {
"moonshot/kimi-k2.5": {
"moonshot/kimi-k2.6": {
params: {
thinking: { type: "disabled" },
},
@@ -288,6 +299,28 @@ Config lives under `plugins.entries.moonshot.config.webSearch`:
When Moonshot thinking is enabled, `tool_choice` must be `auto` or `none`. OpenClaw normalizes incompatible `tool_choice` values to `auto` for compatibility.
</Warning>
Kimi K2.6 also accepts an optional `thinking.keep` field that controls
multi-turn retention of `reasoning_content`. Set it to `"all"` to keep full
reasoning across turns; omit it (or leave it `null`) to use the server
default strategy. OpenClaw only forwards `thinking.keep` for
`moonshot/kimi-k2.6` and strips it from other models.
```json5
{
agents: {
defaults: {
models: {
"moonshot/kimi-k2.6": {
params: {
thinking: { type: "enabled", keep: "all" },
},
},
},
},
},
}
```
</Accordion>
<Accordion title="Streaming usage compatibility">
@@ -306,7 +339,7 @@ Config lives under `plugins.entries.moonshot.config.webSearch`:
| Kimi Coding| `kimi/` | Kimi Coding endpoint | `KIMI_API_KEY` |
| Web search | N/A | Same as Moonshot API region | `KIMI_API_KEY` or `MOONSHOT_API_KEY` |
- Kimi web search uses `KIMI_API_KEY` or `MOONSHOT_API_KEY`, and defaults to `https://api.moonshot.ai/v1` with model `kimi-k2.5`.
- Kimi web search uses `KIMI_API_KEY` or `MOONSHOT_API_KEY`, and defaults to `https://api.moonshot.ai/v1` with model `kimi-k2.6`.
- Override pricing and context metadata in `models.providers` if needed.
- If Moonshot publishes different context limits for a model, adjust `contextWindow` accordingly.

View File

@@ -34,7 +34,7 @@ When you choose **Kimi** during `openclaw onboard` or
- the Moonshot API region:
- `https://api.moonshot.ai/v1`
- `https://api.moonshot.cn/v1`
- the default Kimi web-search model (defaults to `kimi-k2.5`)
- the default Kimi web-search model (defaults to `kimi-k2.6`)
## Config
@@ -47,7 +47,7 @@ When you choose **Kimi** during `openclaw onboard` or
webSearch: {
apiKey: "sk-...", // optional if KIMI_API_KEY or MOONSHOT_API_KEY is set
baseUrl: "https://api.moonshot.ai/v1",
model: "kimi-k2.5",
model: "kimi-k2.6",
},
},
},
@@ -74,7 +74,7 @@ with `tools.web.search.kimi.baseUrl` when you need a different search base URL.
Gateway environment. For a gateway install, put it in `~/.openclaw/.env`.
If you omit `baseUrl`, OpenClaw defaults to `https://api.moonshot.ai/v1`.
If you omit `model`, OpenClaw defaults to `kimi-k2.5`.
If you omit `model`, OpenClaw defaults to `kimi-k2.6`.
## How it works

View File

@@ -220,7 +220,7 @@ When you choose **Kimi** during `openclaw onboard` or
`openclaw configure --section web`, OpenClaw can also ask for:
- the Moonshot API region (`https://api.moonshot.ai/v1` or `https://api.moonshot.cn/v1`)
- the default Kimi web-search model (defaults to `kimi-k2.5`)
- the default Kimi web-search model (defaults to `kimi-k2.6`)
For `x_search`, configure `plugins.entries.xai.config.xSearch.*`. It uses the
same `XAI_API_KEY` fallback as Grok web search.