diff --git a/packages/ai/scripts/generate-models.ts b/packages/ai/scripts/generate-models.ts index 3599bce6c..9163028c4 100644 --- a/packages/ai/scripts/generate-models.ts +++ b/packages/ai/scripts/generate-models.ts @@ -2433,12 +2433,15 @@ async function loadModelsDevData(): Promise[]> { baseUrl, reasoning: isKimiK3 || m.reasoning === true, input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"], - cost: { - input: m.cost?.input || (isKimiK3 ? KIMI_K3_COST.input : 0), - output: m.cost?.output || (isKimiK3 ? KIMI_K3_COST.output : 0), - cacheRead: m.cost?.cache_read || (isKimiK3 ? KIMI_K3_COST.cacheRead : 0), - cacheWrite: m.cost?.cache_write || (isKimiK3 ? KIMI_K3_COST.cacheWrite : 0), - }, + // Moonshot does not bill cache writes; models.dev lists the input rate as cache_write for Kimi K3. + cost: isKimiK3 + ? { ...KIMI_K3_COST } + : { + input: m.cost?.input || 0, + output: m.cost?.output || 0, + cacheRead: m.cost?.cache_read || 0, + cacheWrite: m.cost?.cache_write || 0, + }, contextWindow: m.limit?.context || 4096, maxTokens: m.limit?.output || 4096, compat, diff --git a/packages/ai/test/anthropic-adaptive-thinking-models.test.ts b/packages/ai/test/anthropic-adaptive-thinking-models.test.ts index 1b1be72dc..9efa7de35 100644 --- a/packages/ai/test/anthropic-adaptive-thinking-models.test.ts +++ b/packages/ai/test/anthropic-adaptive-thinking-models.test.ts @@ -4,6 +4,7 @@ import type { Api, Model } from "../src/types.ts"; const EXPECTED_CURRENT_ADAPTIVE_THINKING_MODELS = [ "anthropic/claude-fable-5", + "anthropic/claude-haiku-5-5", "anthropic/claude-opus-4-8", "anthropic/claude-opus-5", "anthropic/claude-sonnet-5", @@ -40,7 +41,9 @@ describe("Anthropic adaptive thinking model metadata", () => { // Regression for #9323: Fireworks uses catalog effort metadata and // verified fallbacks, not a fixed set of adaptive model names. modelId.startsWith("fireworks/") || - /(opus[-.](4[-.][678]|5)|sonnet[-.]4[-.]6|sonnet[-.]5|fable[-.]5|kimi-coding\/)/.test(modelId), + /(opus[-.](4[-.][678]|5)|sonnet[-.]4[-.]6|sonnet[-.]5|haiku[-.]5[-.]5|fable[-.]5|kimi-coding\/)/.test( + modelId, + ), ), ); });