Skip to content

🤖 fix: apply OpenAI's GPT-5.6 Luna and Terra price cut - #3766

Open
ibetitsmike wants to merge 1 commit into
mainfrom
mike/pricing-mh8e
Open

🤖 fix: apply OpenAI's GPT-5.6 Luna and Terra price cut#3766
ibetitsmike wants to merge 1 commit into
mainfrom
mike/pricing-mh8e

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Applies OpenAI's July 30, 2026 API price cut for GPT-5.6 Luna (80% cheaper) and Terra (20% cheaper) to Mux's hand-maintained model pricing table. Sol is unchanged.

Background

OpenAI lowered Luna and Terra API pricing effective July 30, 2026: Terra to $2/M input and $12/M output, Luna to $0.20/M input and $1.20/M output.

Mux cannot pick this up automatically. scripts/update_models.ts syncs pricing from upstream LiteLLM into models.json, but the entire GPT-5.6 family is absent from LiteLLM, so Sol/Terra/Luna live in models-extra.ts, the hand-maintained fallback table. Running the sync script is a no-op for these models, which left every Luna and Terra cost readout in the app overstated by up to 5x.

Implementation

Base input/output rates come straight from OpenAI's announcement. The derived rates follow the multipliers already documented for this family in models-extra.ts:

  • Cached input: 0.1x input (OpenAI's 90% cached-input discount)
  • Cache writes: 1.25x the active input rate
  • Above the 272K long-context boundary: 2x input, 1.5x output (cache reads and writes scale with the input tier)
Field Terra Luna
input $2.50 -> $2.00 /M $1.00 -> $0.20 /M
output $15.00 -> $12.00 /M $6.00 -> $1.20 /M
cached read $0.25 -> $0.20 /M $0.10 -> $0.02 /M
cache write $3.125 -> $2.50 /M $1.25 -> $0.25 /M

Context window (1.05M), max output (128K), and the 272K tier boundary are unchanged.

knownModels.ts carried the old rates in comments next to each model definition; those are updated so the two sources do not disagree.

Validation

The Luna cost-math case in displayUsage.test.ts needed a precision fix beyond the rate swap. All four expected costs now land near or below 1e-3, where toBeCloseTo's default precision of 2 passes for any value within 0.005, so the assertions would have held even against the old (5x higher) rates. They are pinned to precision 10 to keep the test meaningful.

Confirmed no Storybook story renders GPT-5.6 per-token prices, so no visual baselines shift.

Risks

Low blast radius: data-only change to a lookup table, no logic touched.

One user-visible side effect worth calling out: costs are recomputed from stored token counts at display time via createDisplayUsage / recomputeUsageCosts rather than read from a persisted dollar amount. Historical Luna and Terra sessions will therefore re-price at the new lower rates in the costs UI. That is consistent with how every previous pricing correction in this table has behaved.


Generated with mux • Model: anthropic:claude-opus-5 • Thinking: max

Luna drops 80% ($1 -> $0.20/M input, $6 -> $1.20/M output) and Terra
drops 20% ($2.50 -> $2/M input, $15 -> $12/M output). Cached-read,
cache-write, and >272K long-context rates are derived from the new base
rates using the same multipliers already documented for the family.

These models are hand-maintained in models-extra.ts because the GPT-5.6
family is not in upstream LiteLLM, so scripts/update_models.ts cannot
pick this up.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 66bc282ae1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant