diff --git a/.changeset/fn-7847-model-pricing.md b/.changeset/fn-7847-model-pricing.md new file mode 100644 index 0000000000..dddd7daad0 --- /dev/null +++ b/.changeset/fn-7847-model-pricing.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": minor +--- + +summary: Add cost data for GLM-5.2, MiniMax-M3, and Kimi K2.6 so their token usage shows a dollar cost instead of "—". +category: feature +dev: Adds static MODEL_PRICING rows for zai:glm-5.2, minimax:MiniMax-M3, and kimi-coding:kimi-k2.6-preview (not covered by the LiteLLM refresh) and bumps pricingAsOf to 2026-07-11. diff --git a/packages/core/src/__tests__/model-pricing.test.ts b/packages/core/src/__tests__/model-pricing.test.ts index 33738363b9..0c936bea56 100644 --- a/packages/core/src/__tests__/model-pricing.test.ts +++ b/packages/core/src/__tests__/model-pricing.test.ts @@ -113,6 +113,24 @@ describe("model-pricing", () => { expect(result.usd).toBeCloseTo(4.875, 3); }); + it("prices GLM-5.2, MiniMax-M3, and Kimi K2.6 instead of reporting unavailable", () => { + const cases = [ + { provider: "zai", model: "glm-5.2", expectedUsd: 2.28 }, + { provider: "minimax", model: "MiniMax-M3", expectedUsd: 0.54 }, + { provider: "kimi-coding", model: "kimi-k2.6-preview", expectedUsd: 1.75 }, + ] as const; + + for (const { provider, model, expectedUsd } of cases) { + const result = costFor( + { ...ZERO, inputTokens: 1_000_000, outputTokens: 200_000 }, + { provider, model }, + ); + expect(result.unavailable).toBe(false); + expect(result.usd).not.toBeNull(); + expect(result.usd).toBeCloseTo(expectedUsd, 2); + } + }); + it("returns unavailable + null usd for an unknown model (never guesses)", () => { const result = costFor( { ...ZERO, inputTokens: 1_000_000 }, @@ -228,6 +246,9 @@ describe("model-pricing", () => { expect( lookupPricing({ provider: " OpenAI ", model: " GPT-4o " }), ).toBe(MODEL_PRICING["openai:gpt-4o"]); + expect( + lookupPricing({ provider: " MiniMax ", model: " MiniMax-M3 " }), + ).toBe(MODEL_PRICING["minimax:minimax-m3"]); }); it("resolves OpenAI Codex models by explicit provider:model keys", () => { @@ -247,6 +268,9 @@ describe("model-pricing", () => { expect(lookupPricing({ model: "gemini-2.5-pro" })).toBe( MODEL_PRICING["google:gemini-2.5-pro"], ); + expect(lookupPricing({ model: "kimi-k2.6-preview" })).toBe( + MODEL_PRICING["kimi-coding:kimi-k2.6-preview"], + ); }); it("returns undefined for empty / unknown input", () => { diff --git a/packages/core/src/model-pricing.ts b/packages/core/src/model-pricing.ts index 5ee4c53b2b..d1056af860 100644 --- a/packages/core/src/model-pricing.ts +++ b/packages/core/src/model-pricing.ts @@ -28,7 +28,7 @@ * The date the rates in {@link MODEL_PRICING} were last verified, ISO-8601. * Bump this whenever you edit a rate. Surfaced in the UI as "prices as of". */ -export const pricingAsOf = "2026-07-09"; +export const pricingAsOf = "2026-07-11"; /** * Pricing entries older than this (relative to a caller-supplied `now`) are @@ -384,6 +384,40 @@ export const MODEL_PRICING: Readonly> = { cacheWritePer1M: 1.25, source: "ai.google.dev/gemini-api/docs/pricing", }, + + /* + * FNXC:ModelCatalog 2026-07-11-23:02: + * The LiteLLM pricing refresh only maps OpenAI, Anthropic, and Google providers, so Z.ai, MiniMax, and Kimi Coding runs need static rows to keep Dashboard token-cost surfaces from rendering `—`. Rates are verified from https://docs.z.ai/guides/overview/pricing.md, https://platform.minimax.io/docs/guides/pricing-paygo.md, and https://platform.kimi.ai/docs/pricing/chat-k26.md; MiniMax uses the Standard ≤512k pay-as-you-go tier because MODEL_PRICING has no request-tier dimension. + */ + // ── Zhipu AI (Z.ai) ───────────────────────────────────────────────── + // No distinct cache-write token charge → cacheWrite = input rate. + "zai:glm-5.2": { + inputPer1M: 1.4, + outputPer1M: 4.4, + cacheReadPer1M: 0.26, + cacheWritePer1M: 1.4, + source: "docs.z.ai/guides/overview/pricing.md", + }, + + // ── MiniMax ───────────────────────────────────────────────────────── + // Standard pay-as-you-go ≤512k tier; no M3 cache-write row → cacheWrite = input rate. + "minimax:minimax-m3": { + inputPer1M: 0.3, + outputPer1M: 1.2, + cacheReadPer1M: 0.06, + cacheWritePer1M: 0.3, + source: "platform.minimax.io/docs/guides/pricing-paygo.md", + }, + + // ── Moonshot AI (Kimi) ────────────────────────────────────────────── + // Cache miss is the input rate; no distinct cache-write charge → cacheWrite = input rate. + "kimi-coding:kimi-k2.6-preview": { + inputPer1M: 0.95, + outputPer1M: 4, + cacheReadPer1M: 0.16, + cacheWritePer1M: 0.95, + source: "platform.kimi.ai/docs/pricing/chat-k26.md", + }, }; /** Reference to a model, by provider + id (either may be unset). */