Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Add reviewed display pricing for the October catalog additions — `claude-sonnet-5-5`, `gpt-6.1-sol` (with its 272K long-context tier), `deepseek/deepseek-v4.1-flash-fast`, and the free `inclusionai/ling-3.1-flash:free`. Apply the DeepSeek V4 weekday peak-pricing window to `deepseek/deepseek-v4.1-flash-fast`. Models absent from `MODEL_COSTS` silently fall back to a zero display cost, so the snapshot now covers all 85 advertised models.

## 0.7.5 - 2026-10-06

- Harden the `test-pi-local.mjs` temp-home cleanup against transient `ENOTEMPTY` when RPC children flush session files while exiting: poll with fresh removal attempts instead of relying on `maxRetries`, whose behavior on `ENOTEMPTY` varies across Node versions. Test-only change; the 0.7.4 release run failed on this cleanup after all tests had passed.
Expand Down
1 change: 1 addition & 0 deletions src/cost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const DEEPSEEK_V4_TIME_PRICED_MODELS = new Set([
"deepseek/deepseek-v4-flash",
"deepseek/deepseek-v4-flash-vision-exp",
"deepseek/deepseek-v4.1-flash",
"deepseek/deepseek-v4.1-flash-fast",
])

/**
Expand Down
17 changes: 16 additions & 1 deletion src/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface TemporaryPricing {
}

export const PRICING_SOURCE_URL = "https://commandcode.ai/docs/resources/pricing-limits"
export const PRICING_LAST_VERIFIED = "2026-09-29"
export const PRICING_LAST_VERIFIED = "2026-10-05"

export const ZERO_MODEL_COST: CommandCodeModelCost = {
input: 0,
Expand All @@ -40,6 +40,7 @@ export const ZERO_MODEL_COST: CommandCodeModelCost = {
export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
// Free models
"inclusionai/ling-3.0-flash-sante:free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
"inclusionai/ling-3.1-flash:free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
"poolside/laguna-s-2.1-free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
"stealth/space-bunny-alpha": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

Expand Down Expand Up @@ -98,6 +99,12 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
cacheRead: 0.003,
cacheWrite: 0,
},
"deepseek/deepseek-v4.1-flash-fast": {
input: 0.16,
output: 0.58,
cacheRead: 0.016,
cacheWrite: 0,
},
"Qwen/Qwen3.8-Max": { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 2.5 },
"Qwen/Qwen3.8-Max-0902": { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 0 },
"Qwen/Qwen3.8-27B": { input: 0.4, output: 3, cacheRead: 0.04, cacheWrite: 0 },
Expand Down Expand Up @@ -194,6 +201,7 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
},

// Anthropic
"claude-sonnet-5-5": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
"claude-sonnet-5": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
"claude-sonnet-4-6": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
"claude-fable-5-1": { input: 10, output: 50, cacheRead: 0.25, cacheWrite: 12.5 },
Expand All @@ -217,6 +225,13 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
cacheWrite: 12.5,
tiers: [{ inputTokensAbove: 272_000, input: 20, output: 75, cacheRead: 2, cacheWrite: 25 }],
},
"gpt-6.1-sol": {
input: 2,
output: 10,
cacheRead: 0.1,
cacheWrite: 2.5,
tiers: [{ inputTokensAbove: 272_000, input: 4, output: 15, cacheRead: 0.2, cacheWrite: 5 }],
},
"gpt-6-sol": {
input: 2,
output: 10,
Expand Down
6 changes: 5 additions & 1 deletion tests/fixtures/commandcode-model-ids.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"fetchedAt": "2026-09-24T10:38:04.227Z",
"fetchedAt": "2026-10-05T19:58:38.015Z",
"source": "https://api.commandcode.ai/provider/v1/models",
"modelIds": [
"claude-sonnet-5-5",
"claude-sonnet-5",
"claude-sonnet-4-6",
"claude-fable-5-1",
Expand All @@ -12,6 +13,7 @@
"claude-opus-4-7",
"claude-haiku-4-5-20251001",
"gpt-6-astra",
"gpt-6.1-sol",
"gpt-6-sol",
"gpt-6-luna",
"gpt-5.6-sol",
Expand All @@ -26,6 +28,7 @@
"deepseek/deepseek-v4-flash-vision-exp",
"deepseek/deepseek-v4-flash-fast",
"deepseek/deepseek-v4.1-flash",
"deepseek/deepseek-v4.1-flash-fast",
"moonshotai/Kimi-K3",
"moonshotai/Kimi-K2.7-Code",
"moonshotai/Kimi-K2.7-Code-Highspeed",
Expand Down Expand Up @@ -75,6 +78,7 @@
"stealth/space-bunny-alpha",
"poolside/laguna-s-2.1-free",
"inclusionai/ling-3.0-flash-sante:free",
"inclusionai/ling-3.1-flash:free",
"meta/muse-spark-1.1",
"meta/muse-spark-1.2",
"meta/muse-spark-1.2-contributor",
Expand Down
7 changes: 6 additions & 1 deletion tests/fixtures/commandcode-pricing.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"verifiedAt": "2026-09-29",
"verifiedAt": "2026-10-05",
"source": "https://commandcode.ai/docs/resources/pricing-limits",
"tierPolicy": "Use request-wide input tiers; the highest threshold exceeded by input plus cache tokens applies to the full request.",
"tiers": {
Expand All @@ -9,6 +9,7 @@
[256000, 0.2, 0.8, 0.04, 0.25]
],
"gpt-6-astra": [[272000, 20, 75, 2, 25]],
"gpt-6.1-sol": [[272000, 4, 15, 0.2, 5]],
"gpt-6-sol": [[272000, 4, 15, 0.4, 5]],
"gpt-6-luna": [[272000, 0.2, 0.75, 0.02, 0.25]],
"gpt-5.6-sol": [[272000, 10, 45, 1, 12.5]],
Expand All @@ -19,6 +20,7 @@
},
"costs": {
"inclusionai/ling-3.0-flash-sante:free": [0, 0, 0, 0],
"inclusionai/ling-3.1-flash:free": [0, 0, 0, 0],
"poolside/laguna-s-2.1-free": [0, 0, 0, 0],
"stealth/space-bunny-alpha": [0, 0, 0, 0],
"tencent/hy3-paid": [0.14, 0.58, 0.035, 0],
Expand All @@ -43,6 +45,7 @@
"deepseek/deepseek-v4-flash-vision-exp": [0.15, 0.6, 0.003, 0],
"deepseek/deepseek-v4-flash-fast": [0.28, 0.56, 0.07, 0],
"deepseek/deepseek-v4.1-flash": [0.15, 0.6, 0.003, 0],
"deepseek/deepseek-v4.1-flash-fast": [0.16, 0.58, 0.016, 0],
"Qwen/Qwen3.8-Max": [2, 6, 0.25, 2.5],
"Qwen/Qwen3.8-Max-0902": [2, 6, 0.25, 0],
"Qwen/Qwen3.8-27B": [0.4, 3, 0.04, 0],
Expand Down Expand Up @@ -71,6 +74,7 @@
"meta/muse-spark-1.3": [1.25, 4.25, 0.15, 0],
"meta/muse-spark-1.2-contributor": [0.1, 0.2, 0.002, 0],
"meta/muse-spark-1.3-contributor": [0.1, 0.2, 0.002, 0],
"claude-sonnet-5-5": [2, 10, 0.2, 2.5],
"claude-sonnet-5": [2, 10, 0.2, 2.5],
"claude-sonnet-4-6": [3, 15, 0.3, 3.75],
"claude-fable-5-1": [10, 50, 0.25, 12.5],
Expand All @@ -81,6 +85,7 @@
"claude-opus-4-7": [5, 25, 0.5, 6.25],
"claude-haiku-4-5-20251001": [1, 5, 0.1, 1.25],
"gpt-6-astra": [10, 50, 1, 12.5],
"gpt-6.1-sol": [2, 10, 0.1, 2.5],
"gpt-6-sol": [2, 10, 0.2, 2.5],
"gpt-6-luna": [0.1, 0.5, 0.01, 0.125],
"gpt-5.6-sol": [5, 30, 0.5, 6.25],
Expand Down
3 changes: 2 additions & 1 deletion tests/test-cost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,13 @@ describe("calculateCommandCodeCost()", () => {
assertClose(usage.cost.total, 1.32 + 3.96 + 0.044)
})

it("applies peak pricing to every time-priced DeepSeek V4 model but not flash-fast", () => {
it("applies peak pricing to every time-priced DeepSeek V4 model but not V4 Flash Fast", () => {
const timePriced = [
"deepseek/deepseek-v4-pro",
"deepseek/deepseek-v4-flash",
"deepseek/deepseek-v4-flash-vision-exp",
"deepseek/deepseek-v4.1-flash",
"deepseek/deepseek-v4.1-flash-fast",
]

for (const modelId of timePriced) {
Expand Down
36 changes: 34 additions & 2 deletions tests/test-pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const freeModels = new Set([
"poolside/laguna-s-2.1-free",
"stealth/space-bunny-alpha",
"inclusionai/ling-3.0-flash-sante:free",
"inclusionai/ling-3.1-flash:free",
])

function assertCost(
Expand All @@ -54,7 +55,7 @@ function assertCost(
describe("MODEL_COSTS pricing overlay", () => {
it("covers the current Command Code model catalog snapshot", () => {
assert.equal(fixture.source, "https://api.commandcode.ai/provider/v1/models")
assert.match(fixture.fetchedAt, /^2026-09-24T/)
assert.match(fixture.fetchedAt, /^2026-10-05T/)

const catalogIds = [...fixture.modelIds].sort()
const pricedIds = Object.keys(MODEL_COSTS).sort()
Expand Down Expand Up @@ -278,9 +279,40 @@ describe("MODEL_COSTS pricing overlay", () => {
})
})

it("uses reviewed rates for the October catalog additions", () => {
assertCost("claude-sonnet-5-5", {
input: 2,
output: 10,
cacheRead: 0.2,
cacheWrite: 2.5,
})
assertCost("gpt-6.1-sol", { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5 })
assert.deepEqual(MODEL_COSTS["gpt-6.1-sol"]?.tiers, [
{
inputTokensAbove: 272_000,
input: 4,
output: 15,
cacheRead: 0.2,
cacheWrite: 5,
},
])
assertCost("deepseek/deepseek-v4.1-flash-fast", {
input: 0.16,
output: 0.58,
cacheRead: 0.016,
cacheWrite: 0,
})
assertCost("inclusionai/ling-3.1-flash:free", {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
})
})

it("tracks pricing provenance", () => {
assert.equal(PRICING_SOURCE_URL, "https://commandcode.ai/docs/resources/pricing-limits")
assert.equal(PRICING_LAST_VERIFIED, "2026-09-29")
assert.equal(PRICING_LAST_VERIFIED, "2026-10-05")
})

it("fails once temporary pricing needs review", () => {
Expand Down
Loading