FN-7847: add pricing for GLM-5.2, MiniMax-M3, and Kimi K2.6

Adds static MODEL_PRICING rows for three previously-unpriced models so their token usage renders a dollar cost instead of "—" in the dashboard.

- Add zai:glm-5.2, minimax:minimax-m3, and kimi-coding:kimi-k2.6-preview pricing rows to MODEL_PRICING, sourced from each provider's public pricing docs
- Bump pricingAsOf to 2026-07-11
- Add regression tests asserting costFor() prices these three models (not unavailable) and that lookupPricing() resolves them by provider-normalized and bare model-id keys
- Add a minor changeset documenting the pricing addition for @runfusion/fusion release notes

Files changed:
 .changeset/fn-7847-model-pricing.md               |  7 +++++
 packages/core/src/__tests__/model-pricing.test.ts | 24 +++++++++++++++
 packages/core/src/model-pricing.ts                | 36 ++++++++++++++++++++++-
 3 files changed, 66 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-7847

Fusion-Task-Lineage: 6c138aa3-53e9-4165-909d-c8fc02acb48b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
This commit is contained in:
gsxdsm
2026-07-11 23:09:41 -07:00
parent 9b7623bc4c
commit d99c04cded
3 changed files with 66 additions and 1 deletions

View File

@@ -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.

View File

@@ -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", () => {

View File

@@ -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<Record<string, ModelPricing>> = {
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). */