Skip to content

fix(pricing): price GPT-5.6, Claude Opus 5 and every other unpriced model in the store - #319

Merged
upsetbit merged 7 commits into
masterfrom
fix/price-new-models
Jul 25, 2026
Merged

fix(pricing): price GPT-5.6, Claude Opus 5 and every other unpriced model in the store#319
upsetbit merged 7 commits into
masterfrom
fix/price-new-models

Conversation

@upsetbit

Copy link
Copy Markdown
Contributor

Why

New OpenAI and Anthropic models entered use but were missing from the rate
table, so they showed up in analytics usage_by_model with tokens counted and
EST_COST_USD blank. The biggest hole was gpt-5.6-sol: 406 sessions,
7.76B measured tokens, no cost attributed.

Rather than guess, I queried the live store via
AnalyticsService/GetReport (models and usage_by_model) and worked from the
actual 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 no
backfill: merging and redeploying reprices the whole history retroactively.

Commit Models
fix Composer 2.5 $3/$15$0.50/$2.50 + $0.20 cache read (Cursor's own table; the entry overcharged 6×)
GPT-5.6 gpt-5.6-sol, -terra, -luna, plus a gpt-5.6 → sol alias
Anthropic claude-opus-5, claude-mythos-5
GLM / Gemini / o3 glm-4.7, glm-4.5-air (new Z.AI block), gemini-3-pro, gemini-3.1-pro, o3
Composer composer-1, composer-1.5, composer-2, composer-2-fast
Normalization Cursor's family-last Claude ids (claude-4.6-opus-high-thinking) rewritten to canonical order
Grok grok-code-fast-1, as two date-effective rate periods

GPT-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-5 also reports blank cost in production, and this PR does not
    fix it.
    The entry has existed since 2fc2241e (v0.27.4) — the deployed
    server binary simply predates it. Redeploying is the fix.
  • Opus 5 fast mode costs $10/$50 but reuses the same model id, so those
    sessions are estimated at the standard rate. Documented in the table, not
    worked around.
  • grok-code-fast-1 is the one disputed number. xAI's model page says
    $1.00/$0.20/$2.00; its retirement notice says post-2026-05-15 requests bill
    at grok-4.3 rates. Modelled as launch-then-grok-4.3 periods. The 43 sessions
    have 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 CLI
integration tag, golangci-lint (0 issues), gofumpt and go mod tidy all
clean 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) and
not-a-real-model-name still do not.

Sources: developers.openai.com/api/docs/pricing,
platform.claude.com model 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

upsetbit and others added 7 commits July 25, 2026 11:13
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>
@upsetbit
upsetbit merged commit d9aaab2 into master Jul 25, 2026
4 checks passed
@upsetbit
upsetbit deleted the fix/price-new-models branch July 25, 2026 14:24
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