diff --git a/src/main/codex-usage/codex-model-pricing.ts b/src/main/codex-usage/codex-model-pricing.ts index f7ae9076566..8e576f9a772 100644 --- a/src/main/codex-usage/codex-model-pricing.ts +++ b/src/main/codex-usage/codex-model-pricing.ts @@ -74,6 +74,12 @@ export const MODEL_PRICING: Record = { output: 10, longContext: { input: 4, cachedInput: 0.4, output: 15 } }, + 'gpt-6.1-sol': { + input: 2, + cachedInput: 0.1, + output: 10, + longContext: { input: 4, cachedInput: 0.2, output: 15 } + }, 'gpt-6-luna': { input: 0.1, cachedInput: 0.01, @@ -184,6 +190,9 @@ export function normalizeModelForPricing(model: string | null): string | null { if (normalized === 'gpt-6-sol' || normalized.startsWith('gpt-6-sol-')) { return 'gpt-6-sol' } + if (normalized === 'gpt-6.1-sol' || normalized.startsWith('gpt-6.1-sol-')) { + return 'gpt-6.1-sol' + } if (normalized === 'gpt-6-luna' || normalized.startsWith('gpt-6-luna-')) { return 'gpt-6-luna' } diff --git a/src/main/codex-usage/codex-usage-cost-estimate.test.ts b/src/main/codex-usage/codex-usage-cost-estimate.test.ts index 57d4cfce899..492c9dad545 100644 --- a/src/main/codex-usage/codex-usage-cost-estimate.test.ts +++ b/src/main/codex-usage/codex-usage-cost-estimate.test.ts @@ -69,6 +69,19 @@ describe('estimateCostUsd', () => { ) }) + it.each(['gpt-6.1-sol', 'gpt-6.1-sol-high', 'gpt-6.1-sol(max)'])( + 'prices %s at GPT-6.1 Sol rates rather than GPT-6 Sol', + (model) => { + // Base $2 / $0.10 / $10: 1M*2 + 1M*0.1 + 1M*10. + expect(estimateCostUsd(model, shortContext(2_000_000, 1_000_000, 1_000_000))).toBeCloseTo( + 12.1, + 9 + ) + // Long $4 / $0.20 / $15: 0.15M*4 + 0.15M*0.2 + 0.1M*15. + expect(estimateCostUsd(model, longContext(300_000, 150_000, 100_000))).toBeCloseTo(2.13, 9) + } + ) + it('returns null for an unpriced model', () => { expect(estimateCostUsd('gpt-7-unreleased', shortContext(1, 0, 1))).toBeNull() })