fix(usage): include GPT-6.1 Sol in Codex cost estimates (#29707)

Price gpt-6.1-sol (and its effort/suffix variants) at its own base and
long-context rates instead of leaving it unpriced.

Co-authored-by: Rongzheng Liu <tianlrz@users.noreply.github.com>
This commit is contained in:
Rongzheng Liu
2026-10-26 15:11:00 -07:00
committed by GitHub
co-authored by Rongzheng Liu
parent a96171d1ac
commit b2270cd184
2 changed files with 22 additions and 0 deletions
@@ -74,6 +74,12 @@ export const MODEL_PRICING: Record<string, CodexModelPricing> = {
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'
}
@@ -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()
})