From 0e09ca72edc39bdc34f874d4ac4f30e0f0732d93 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Thu, 12 Feb 2026 19:26:54 +0000 Subject: [PATCH] feat(zai): update glm-5 model specs with correct pricing, context window, and max output tokens - International: input $1.00, output $3.20, cached $0.20 per 1M tokens (per z.ai docs) - Mainland: proportionally scaled pricing based on existing model ratios - Context window: 200k tokens (was 202,752) - Max output tokens: 128k (was 16,384) - Updated test expectations to match new contextWindow value Closes #11438 --- packages/types/src/providers/zai.ts | 24 ++++++++++++------------ src/api/providers/__tests__/zai.spec.ts | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/types/src/providers/zai.ts b/packages/types/src/providers/zai.ts index 69f90f232a..f5b9b0b0e5 100644 --- a/packages/types/src/providers/zai.ts +++ b/packages/types/src/providers/zai.ts @@ -121,19 +121,19 @@ export const internationalZAiModels = { "GLM-4.7 is Zhipu's latest model with built-in thinking capabilities enabled by default. It provides enhanced reasoning for complex tasks while maintaining fast response times.", }, "glm-5": { - maxTokens: 16_384, - contextWindow: 202_752, + maxTokens: 128_000, + contextWindow: 200_000, supportsImages: false, supportsPromptCache: true, supportsReasoningEffort: ["disable", "medium"], reasoningEffort: "medium", preserveReasoning: true, - inputPrice: 0.6, - outputPrice: 2.2, + inputPrice: 1.0, + outputPrice: 3.2, cacheWritesPrice: 0, - cacheReadsPrice: 0.11, + cacheReadsPrice: 0.2, description: - "GLM-5 is Zhipu's next-generation model with a 202k context window and built-in thinking capabilities. It delivers state-of-the-art reasoning, coding, and agentic performance.", + "GLM-5 is Zhipu's next-generation model with a 200k context window, 128k max output, and built-in thinking capabilities. It delivers state-of-the-art reasoning, coding, and agentic performance.", }, "glm-4.7-flash": { maxTokens: 16_384, @@ -297,19 +297,19 @@ export const mainlandZAiModels = { "GLM-4.7 is Zhipu's latest model with built-in thinking capabilities enabled by default. It provides enhanced reasoning for complex tasks while maintaining fast response times.", }, "glm-5": { - maxTokens: 16_384, - contextWindow: 202_752, + maxTokens: 128_000, + contextWindow: 200_000, supportsImages: false, supportsPromptCache: true, supportsReasoningEffort: ["disable", "medium"], reasoningEffort: "medium", preserveReasoning: true, - inputPrice: 0.29, - outputPrice: 1.14, + inputPrice: 0.48, + outputPrice: 1.66, cacheWritesPrice: 0, - cacheReadsPrice: 0.057, + cacheReadsPrice: 0.1, description: - "GLM-5 is Zhipu's next-generation model with a 202k context window and built-in thinking capabilities. It delivers state-of-the-art reasoning, coding, and agentic performance.", + "GLM-5 is Zhipu's next-generation model with a 200k context window, 128k max output, and built-in thinking capabilities. It delivers state-of-the-art reasoning, coding, and agentic performance.", }, "glm-4.7-flash": { maxTokens: 16_384, diff --git a/src/api/providers/__tests__/zai.spec.ts b/src/api/providers/__tests__/zai.spec.ts index 7703f31786..d057041b80 100644 --- a/src/api/providers/__tests__/zai.spec.ts +++ b/src/api/providers/__tests__/zai.spec.ts @@ -131,7 +131,7 @@ describe("ZAiHandler", () => { const model = handlerWithModel.getModel() expect(model.id).toBe(testModelId) expect(model.info).toEqual(internationalZAiModels[testModelId]) - expect(model.info.contextWindow).toBe(202_752) + expect(model.info.contextWindow).toBe(200_000) expect(model.info.supportsReasoningEffort).toEqual(["disable", "medium"]) expect(model.info.reasoningEffort).toBe("medium") expect(model.info.preserveReasoning).toBe(true) @@ -230,7 +230,7 @@ describe("ZAiHandler", () => { const model = handlerWithModel.getModel() expect(model.id).toBe(testModelId) expect(model.info).toEqual(mainlandZAiModels[testModelId]) - expect(model.info.contextWindow).toBe(202_752) + expect(model.info.contextWindow).toBe(200_000) expect(model.info.supportsReasoningEffort).toEqual(["disable", "medium"]) expect(model.info.reasoningEffort).toBe("medium") expect(model.info.preserveReasoning).toBe(true)