From 630b16805c3f228ed403be09f062bcababfa1664 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 16 Jul 2026 22:41:03 -0700 Subject: [PATCH] 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 --- docs/providers/moonshot.md | 20 +++++++++------ docs/providers/xai.md | 8 ++++++ docs/providers/zai.md | 10 ++++++++ extensions/kimi-coding/index.ts | 8 +++--- extensions/kimi-coding/openclaw.plugin.json | 4 +-- extensions/moonshot/index.ts | 8 +++--- extensions/moonshot/openclaw.plugin.json | 8 +++--- extensions/moonshot/provider-contract-api.ts | 8 +++--- extensions/zai/model-definitions.test.ts | 25 ++++++++++++++----- extensions/zai/openclaw.plugin.json | 22 ++++++++-------- .../plugin-registration-contract-cases.ts | 4 +-- 11 files changed, 81 insertions(+), 44 deletions(-) diff --git a/docs/providers/moonshot.md b/docs/providers/moonshot.md index 5cfc9e75a534..cfd19c4be30c 100644 --- a/docs/providers/moonshot.md +++ b/docs/providers/moonshot.md @@ -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`. + 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). + ```bash diff --git a/docs/providers/xai.md b/docs/providers/xai.md index 2ff6ea114f20..09454ae7aacb 100644 --- a/docs/providers/xai.md +++ b/docs/providers/xai.md @@ -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. +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 diff --git a/docs/providers/zai.md b/docs/providers/zai.md index 2952704dab86..1faee05fb868 100644 --- a/docs/providers/zai.md +++ b/docs/providers/zai.md @@ -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. + GLM models are available as `zai/` (example: `zai/glm-5`). diff --git a/extensions/kimi-coding/index.ts b/extensions/kimi-coding/index.ts index 1e13057eff97..9405760fb9d7 100644 --- a/extensions/kimi-coding/index.ts +++ b/extensions/kimi-coding/index.ts @@ -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", }, }), ], diff --git a/extensions/kimi-coding/openclaw.plugin.json b/extensions/kimi-coding/openclaw.plugin.json index d3f2d3db06fb..d29114487a9f 100644 --- a/extensions/kimi-coding/openclaw.plugin.json +++ b/extensions/kimi-coding/openclaw.plugin.json @@ -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 ", diff --git a/extensions/moonshot/index.ts b/extensions/moonshot/index.ts index ac9bd2b8cad8..5b4be4c6f464 100644 --- a/extensions/moonshot/index.ts +++ b/extensions/moonshot/index.ts @@ -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)", }, }, ], diff --git a/extensions/moonshot/openclaw.plugin.json b/extensions/moonshot/openclaw.plugin.json index e342f981adf4..1281123cdd62 100644 --- a/extensions/moonshot/openclaw.plugin.json +++ b/extensions/moonshot/openclaw.plugin.json @@ -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 ", @@ -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 ", diff --git a/extensions/moonshot/provider-contract-api.ts b/extensions/moonshot/provider-contract-api.ts index 3c2db7bb2602..90e732ea505f 100644 --- a/extensions/moonshot/provider-contract-api.ts +++ b/extensions/moonshot/provider-contract-api.ts @@ -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)", }, }, ], diff --git a/extensions/zai/model-definitions.test.ts b/extensions/zai/model-definitions.test.ts index 5da17e37d53f..11d192441e8e 100644 --- a/extensions/zai/model-definitions.test.ts +++ b/extensions/zai/model-definitions.test.ts @@ -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, }); diff --git a/extensions/zai/openclaw.plugin.json b/extensions/zai/openclaw.plugin.json index a298bd31d774..abd933808fd2 100644 --- a/extensions/zai/openclaw.plugin.json +++ b/extensions/zai/openclaw.plugin.json @@ -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 } } diff --git a/src/plugin-sdk/test-helpers/plugin-registration-contract-cases.ts b/src/plugin-sdk/test-helpers/plugin-registration-contract-cases.ts index a2733c526919..a7e83dcc184f 100644 --- a/src/plugin-sdk/test-helpers/plugin-registration-contract-cases.ts +++ b/src/plugin-sdk/test-helpers/plugin-registration-contract-cases.ts @@ -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: {