fix(providers): refresh zai/kimi/moonshot/xai catalogs against July 2026 vendor docs (#109666)

* fix(providers): refresh vendor catalogs and setup hints

* test(providers): align registration metadata expectations
This commit is contained in:
Peter Steinberger
2026-07-16 22:41:03 -07:00
committed by GitHub
parent 3fee3cc6fa
commit 630b16805c
11 changed files with 81 additions and 44 deletions
+13 -7
View File
@@ -29,13 +29,12 @@ Moonshot and Kimi Coding are **separate providers**, each shipped as a separate
[//]: # "moonshot-kimi-k2-ids:end"
Catalog cost estimates use Moonshot's published pay-as-you-go rates. The
[Kimi K3 pricing](https://platform.kimi.ai/docs/pricing/chat-k3) is $0.30/MTok
cache hit, $3.00/MTok input, and $15.00/MTok output; Kimi K2.7 Code is
$0.19/MTok cache hit, $0.95/MTok input, and $4.00/MTok output; its HighSpeed
variant is $0.38/MTok cache hit, $1.90/MTok input, and $8.00/MTok output. Kimi K2.6 is
$0.16/MTok cache hit, $0.95/MTok input, $4.00/MTok output; Kimi K2.5 is
$0.10/MTok cache hit, $0.60/MTok input, $3.00/MTok output.
Catalog cost estimates use Moonshot's published pay-as-you-go rates. Check the
live vendor pages for [Kimi K3](https://platform.kimi.ai/docs/pricing/chat-k3),
[Kimi K2.7 Code](https://platform.kimi.ai/docs/pricing/chat-k27-code),
[Kimi K2.6](https://platform.kimi.ai/docs/pricing/chat-k26), and
[Kimi K2.5](https://platform.kimi.ai/docs/pricing/chat-k25) before making cost
decisions.
Kimi K3 always reasons at `reasoning_effort: "max"`. OpenClaw exposes only
`/think max`, omits the K2-only `thinking` field, and removes sampling
@@ -216,6 +215,13 @@ onboarding.
Kimi Coding uses a different API key and provider prefix (`kimi/...`) than Moonshot (`moonshot/...`). Current refs are `kimi/k3` for a 256K context, `kimi/k3[1m]` for the 1M tier, `kimi/kimi-for-coding`, and `kimi/kimi-for-coding-highspeed`. Legacy refs `kimi/kimi-code` and `kimi/k2p5` remain accepted and normalize to `kimi/kimi-for-coding`.
</Note>
The coding service accepts both OpenAI-compatible
`https://api.kimi.com/coding/v1` and Anthropic-compatible
`https://api.kimi.com/coding/` clients. This plugin uses Anthropic Messages.
Create membership keys in the
[Kimi Code Console](https://www.kimi.com/code/console); current membership
pricing lives on [Kimi's pricing page](https://www.kimi.com/membership/pricing).
<Steps>
<Step title="Install the plugin">
```bash
+8
View File
@@ -121,6 +121,14 @@ Grok 4.3 remains the regional-safe setup default; `grok-build-0.1` and both
dated Grok 4.20 variants remain selectable.
</Tip>
Catalog context and token-cost metadata follows xAI's live
[model pages](https://docs.x.ai/developers/models) and
[pricing page](https://docs.x.ai/developers/pricing). xAI applies higher rates
when a request crosses its documented long-context threshold; OpenClaw's flat
catalog cost fields record the short-context rates. Grok Build, xAI's separate
coding-agent CLI, is available at [x.ai/cli](https://x.ai/cli) and currently
uses Grok 4.5.
## Feature coverage
The bundled plugin maps supported xAI APIs onto OpenClaw's shared provider and
+10
View File
@@ -87,6 +87,11 @@ openclaw plugins install @openclaw/zai-provider
| `zai-coding-global` | `https://api.z.ai/api/coding/paas/v4` | `glm-5.2` |
| `zai-coding-cn` | `https://open.bigmodel.cn/api/coding/paas/v4` | `glm-5.2` |
Z.AI also publishes the Anthropic-compatible Coding Plan base URL
`https://api.z.ai/api/anthropic`. OpenClaw's Z.AI choices use the documented
OpenAI Chat Completions endpoints above; the Anthropic URL is for clients that
speak Anthropic Messages directly.
`zai-api-key` auto-detects one of these four by probing your key against each
endpoint's chat-completions API, checking general endpoints (`zai-global`,
then `zai-cn`) before Coding Plan endpoints (`zai-coding-global`, then
@@ -177,6 +182,11 @@ The manifest-backed catalog currently includes:
| `zai/glm-4.5-flash` | |
| `zai/glm-4.5v` | |
Catalog token-cost metadata follows Z.AI's current
[pay-as-you-go pricing](https://docs.z.ai/guides/overview/pricing). Coding Plan
subscriptions use plan quota instead of per-token billing; see the live
[subscription page](https://z.ai/subscribe) for plan pricing and availability.
<Tip>
GLM models are available as `zai/<model>` (example: `zai/glm-5`).
</Tip>
+4 -4
View File
@@ -42,7 +42,7 @@ export default definePluginEntry({
providerId: PROVIDER_ID,
methodId: "api-key",
label: "Kimi Code API key (subscription)",
hint: "Kimi K2.6 + Kimi",
hint: "Kimi Code membership · https://www.kimi.com/membership/pricing",
optionKey: "kimiCodeApiKey",
flagName: "--kimi-code-api-key",
envVar: "KIMI_API_KEY",
@@ -52,15 +52,15 @@ export default definePluginEntry({
applyConfig: (cfg) => applyKimiCodeConfig(cfg),
noteMessage: [
"Kimi uses a dedicated coding endpoint and API key.",
"Get your API key at: https://www.kimi.com/code/en",
"Get your API key at: https://www.kimi.com/code/console",
].join("\n"),
noteTitle: "Kimi",
wizard: {
choiceId: "kimi-code-api-key",
choiceLabel: "Kimi Code API key (subscription)",
groupId: "moonshot",
groupLabel: "Moonshot AI (Kimi K2.6)",
groupHint: "Kimi K2.6",
groupLabel: "Moonshot AI (Kimi)",
groupHint: "Kimi Code membership · https://www.kimi.com/membership/pricing",
},
}),
],
+2 -2
View File
@@ -57,8 +57,8 @@
"appGuidedSecret": true,
"choiceLabel": "Kimi Code API key (subscription)",
"groupId": "moonshot",
"groupLabel": "Moonshot AI (Kimi K2.6)",
"groupHint": "Kimi K2.6",
"groupLabel": "Moonshot AI (Kimi)",
"groupHint": "Kimi Code membership · https://www.kimi.com/membership/pricing",
"optionKey": "kimiCodeApiKey",
"cliFlag": "--kimi-code-api-key",
"cliOption": "--kimi-code-api-key <key>",
+4 -4
View File
@@ -28,7 +28,7 @@ export default defineSingleProviderPluginEntry({
{
methodId: "api-key",
label: "Kimi API key (.ai)",
hint: "Kimi K2.6 + Kimi",
hint: "Kimi API models · https://platform.kimi.ai/docs/pricing/chat",
optionKey: "moonshotApiKey",
flagName: "--moonshot-api-key",
envVar: "MOONSHOT_API_KEY",
@@ -36,13 +36,13 @@ export default defineSingleProviderPluginEntry({
defaultModel: MOONSHOT_DEFAULT_MODEL_REF,
applyConfig: (cfg) => applyMoonshotConfig(cfg),
wizard: {
groupLabel: "Moonshot AI (Kimi K2.6)",
groupLabel: "Moonshot AI (Kimi)",
},
},
{
methodId: "api-key-cn",
label: "Kimi API key (.cn)",
hint: "Kimi K2.6 + Kimi",
hint: "Kimi API models · https://platform.kimi.ai/docs/pricing/chat",
optionKey: "moonshotApiKey",
flagName: "--moonshot-api-key",
envVar: "MOONSHOT_API_KEY",
@@ -50,7 +50,7 @@ export default defineSingleProviderPluginEntry({
defaultModel: MOONSHOT_DEFAULT_MODEL_REF,
applyConfig: (cfg) => applyMoonshotConfigCn(cfg),
wizard: {
groupLabel: "Moonshot AI (Kimi K2.6)",
groupLabel: "Moonshot AI (Kimi)",
},
},
],
+4 -4
View File
@@ -154,8 +154,8 @@
"appGuidedSecret": true,
"choiceLabel": "Moonshot API key (.ai)",
"groupId": "moonshot",
"groupLabel": "Moonshot AI (Kimi K2.6)",
"groupHint": "Kimi K2.6",
"groupLabel": "Moonshot AI (Kimi)",
"groupHint": "Kimi API models · https://platform.kimi.ai/docs/pricing/chat",
"optionKey": "moonshotApiKey",
"cliFlag": "--moonshot-api-key",
"cliOption": "--moonshot-api-key <key>",
@@ -168,8 +168,8 @@
"appGuidedSecret": true,
"choiceLabel": "Moonshot API key (.cn)",
"groupId": "moonshot",
"groupLabel": "Moonshot AI (Kimi K2.6)",
"groupHint": "Kimi K2.6",
"groupLabel": "Moonshot AI (Kimi)",
"groupHint": "Kimi API models · https://platform.kimi.ai/docs/pricing/chat",
"optionKey": "moonshotApiKey",
"cliFlag": "--moonshot-api-key",
"cliOption": "--moonshot-api-key <key>",
+4 -4
View File
@@ -14,20 +14,20 @@ export function createMoonshotProvider(): ProviderPlugin {
id: "api-key",
kind: "api_key",
label: "Kimi API key (.ai)",
hint: "Kimi K2.6 + Kimi",
hint: "Kimi API models · https://platform.kimi.ai/docs/pricing/chat",
run: noopAuth,
wizard: {
groupLabel: "Moonshot AI (Kimi K2.6)",
groupLabel: "Moonshot AI (Kimi)",
},
},
{
id: "api-key-cn",
kind: "api_key",
label: "Kimi API key (.cn)",
hint: "Kimi K2.6 + Kimi",
hint: "Kimi API models · https://platform.kimi.ai/docs/pricing/chat",
run: noopAuth,
wizard: {
groupLabel: "Moonshot AI (Kimi K2.6)",
groupLabel: "Moonshot AI (Kimi)",
},
},
],
+19 -6
View File
@@ -39,7 +39,7 @@ describe("zai model definitions", () => {
input: ["text"],
contextWindow: 1_000_000,
maxTokens: 131_072,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
cost: { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
});
});
@@ -50,7 +50,7 @@ describe("zai model definitions", () => {
input: ["text"],
contextWindow: 202800,
maxTokens: 131100,
cost: { input: 1.2, output: 4, cacheRead: 0.24, cacheWrite: 0 },
cost: { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
});
});
@@ -72,7 +72,7 @@ describe("zai model definitions", () => {
input: ["text"],
contextWindow: 202800,
maxTokens: 131100,
cost: ZAI_DEFAULT_COST,
cost: { input: 1, output: 3.2, cacheRead: 0.2, cacheWrite: 0 },
});
});
@@ -82,7 +82,7 @@ describe("zai model definitions", () => {
input: ["text", "image"],
contextWindow: 128000,
maxTokens: 32768,
cost: { input: 0.3, output: 0.9, cacheRead: 0, cacheWrite: 0 },
cost: { input: 0.3, output: 0.9, cacheRead: 0.05, cacheWrite: 0 },
});
expectZaiModelFields({
id: "glm-4.5-air",
@@ -91,18 +91,31 @@ describe("zai model definitions", () => {
maxTokens: 98304,
cost: { input: 0.2, output: 1.1, cacheRead: 0.03, cacheWrite: 0 },
});
expectZaiModelFields({
id: "glm-4.5v",
input: ["text", "image"],
contextWindow: 64000,
maxTokens: 16384,
cost: { input: 0.6, output: 1.8, cacheRead: 0.11, cacheWrite: 0 },
});
});
it("keeps the remaining GLM 4.7/5 pricing and token limits aligned with OpenClaw", () => {
expectZaiModelFields({
id: "glm-4.7",
cost: { input: 0.6, output: 2.2, cacheRead: 0.11, cacheWrite: 0 },
contextWindow: 204800,
maxTokens: 131072,
});
expectZaiModelFields({
id: "glm-4.7-flash",
cost: { input: 0.07, output: 0.4, cacheRead: 0, cacheWrite: 0 },
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 200000,
maxTokens: 131072,
});
expectZaiModelFields({
id: "glm-4.7-flashx",
cost: { input: 0.06, output: 0.4, cacheRead: 0.01, cacheWrite: 0 },
cost: { input: 0.07, output: 0.4, cacheRead: 0.01, cacheWrite: 0 },
contextWindow: 200000,
maxTokens: 128000,
});
+11 -11
View File
@@ -41,9 +41,9 @@
"contextWindow": 1000000,
"maxTokens": 131072,
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"input": 1.4,
"output": 4.4,
"cacheRead": 0.26,
"cacheWrite": 0
}
},
@@ -55,9 +55,9 @@
"contextWindow": 202800,
"maxTokens": 131100,
"cost": {
"input": 1.2,
"output": 4,
"cacheRead": 0.24,
"input": 1.4,
"output": 4.4,
"cacheRead": 0.26,
"cacheWrite": 0
}
},
@@ -125,8 +125,8 @@
"contextWindow": 200000,
"maxTokens": 131072,
"cost": {
"input": 0.07,
"output": 0.4,
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
}
@@ -139,7 +139,7 @@
"contextWindow": 200000,
"maxTokens": 128000,
"cost": {
"input": 0.06,
"input": 0.07,
"output": 0.4,
"cacheRead": 0.01,
"cacheWrite": 0
@@ -169,7 +169,7 @@
"cost": {
"input": 0.3,
"output": 0.9,
"cacheRead": 0,
"cacheRead": 0.05,
"cacheWrite": 0
}
},
@@ -225,7 +225,7 @@
"cost": {
"input": 0.6,
"output": 1.8,
"cacheRead": 0,
"cacheRead": 0.11,
"cacheWrite": 0
}
}
@@ -127,8 +127,8 @@ export const pluginRegistrationContractCases = {
choiceId: "kimi-code-api-key",
choiceLabel: "Kimi Code API key (subscription)",
groupId: "moonshot",
groupLabel: "Moonshot AI (Kimi K2.6)",
groupHint: "Kimi K2.6",
groupLabel: "Moonshot AI (Kimi)",
groupHint: "Kimi Code membership · https://www.kimi.com/membership/pricing",
},
},
nvidia: {