fix(pricing): price GPT-5.6, Claude Opus 5 and every other unpriced model in the store - #319
Merged
Conversation
Composer 2.5 was priced at $3/$15 per MTok. Cursor's own model-pricing table lists $0.50 input, $0.20 cache read and $2.50 output, so the entry overcharged by 6x. No reported numbers move today because Cursor sessions carry no measured usage, but the rate would skew every estimate as soon as the importer starts emitting token counts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds gpt-5.6-sol, gpt-5.6-terra and gpt-5.6-luna, plus a gpt-5.6 -> sol alias for OpenAI's bare flagship id. The prefix fallback cannot reach the bare id on its own because it requires a "gpt-5.6-" separator. GPT-5.6 is the first OpenAI family to bill cache writes separately, so these are the first OpenAI entries with a non-zero CacheCreation rate. gpt-5.6-sol alone accounts for 7.7B measured tokens in the maintainer's store that were being reported with no cost attached. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Opus 5 ships at Opus 4.8's tariff ($5/$25 per MTok); Mythos 5 matches Fable 5 ($10/$50). Both were reporting tokens with no cost attached. Opus 5 fast mode costs $10/$50 but reuses the same model id, so it is indistinguishable in the rate table and those sessions are estimated at the standard rate. Noted in the table rather than worked around. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a Z.AI block (glm-4.7, glm-4.5-air) as the fourth provider in the table, the GA Gemini 3 ids (gemini-3-pro, gemini-3.1-pro) alongside the existing preview keys, and OpenAI's o3. gemini-3-pro is a separate key rather than a rename: the prefix fallback needs a "gemini-3-pro-" separator, so the GA id would not have resolved through the preview entry. Both carry the same tariff. Gemini rates follow the <=200k tier, matching the convention already documented on that block. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds composer-1, composer-1.5, composer-2 and composer-2-fast alongside the existing composer-2.5 entry. composer-2-fast and composer-1.5 each need an explicit key. Without one, composer-2-fast would prefix-match composer-2 and be charged a third of its real rate, and composer-1.5's dotted form never matches the composer-1- prefix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cursor emits Claude ids family-last and dot-versioned (claude-4.6-opus-high-thinking), the inverse of the canonical form. Five such ids already appear in the maintainer's store and the shape produces more with every Anthropic release. NormalizeModel now rewrites them back to claude-<family>-<major>-<minor>, so the existing longest-prefix fallback takes over from there. That is one rule instead of one alias per variant, and its blast radius is contained: Lookup is the only caller of NormalizeModel. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
xAI's sources disagree on this slug: the model page lists $1.00/$0.20/$2.00 while the retirement notice says requests after 2026-05-15 are redirected and billed at grok-4.3 rates. Modelled as two rate periods -- launch pricing before the retirement date, grok-4.3 pricing after -- using the same date-effective mechanism as claude-sonnet-5. The 43 sessions carrying this id have no measured usage, so no reported number moves either way. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
New OpenAI and Anthropic models entered use but were missing from the rate
table, so they showed up in
analytics usage_by_modelwith tokens counted andEST_COST_USDblank. The biggest hole wasgpt-5.6-sol: 406 sessions,7.76B measured tokens, no cost attributed.
Rather than guess, I queried the live store via
AnalyticsService/GetReport(modelsandusage_by_model) and worked from theactual inventory — 53 distinct model ids, 5 of them carrying measured usage with
no price.
What changed
All in
internal/pricing. Cost is computed at query time, so there is nobackfill: merging and redeploying reprices the whole history retroactively.
fixComposer 2.5$3/$15→$0.50/$2.50+$0.20cache read (Cursor's own table; the entry overcharged 6×)gpt-5.6-sol,-terra,-luna, plus agpt-5.6→ sol aliasclaude-opus-5,claude-mythos-5glm-4.7,glm-4.5-air(new Z.AI block),gemini-3-pro,gemini-3.1-pro,o3composer-1,composer-1.5,composer-2,composer-2-fastclaude-4.6-opus-high-thinking) rewritten to canonical ordergrok-code-fast-1, as two date-effective rate periodsGPT-5.6 is the first OpenAI family billing cache writes separately, so it is the
first OpenAI entry with a non-zero
CacheCreation.Notes worth reading
claude-sonnet-5also reports blank cost in production, and this PR does notfix it. The entry has existed since
2fc2241e(v0.27.4) — the deployedserver binary simply predates it. Redeploying is the fix.
$10/$50but reuses the same model id, so thosesessions are estimated at the standard rate. Documented in the table, not
worked around.
grok-code-fast-1is the one disputed number. xAI's model page says$1.00/$0.20/$2.00; its retirement notice says post-2026-05-15 requests billat
grok-4.3rates. Modelled as launch-then-grok-4.3 periods. The 43 sessionshave zero measured usage, so nothing moves either way — it is isolated in the
last commit if you would rather drop it.
Verification
go build,go vet,go test ./...,go test -race ./..., the CLIintegration tag,
golangci-lint(0 issues),gofumptandgo mod tidyallclean locally.
Beyond the test table, I ran a throwaway audit asserting that every one of the
53 ids observed in the live store now resolves, and that
(none)andnot-a-real-model-namestill do not.Sources:
developers.openai.com/api/docs/pricing,platform.claude.commodel docs,docs.z.ai/guides/overview/pricing,ai.google.dev/gemini-api/docs/pricing,cursor.com/docs/models-and-pricing,docs.x.ai/developers/pricing.🤖 Generated with Claude Code