You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(usage): price long-context requests at the published long rate (#908)
Several vendors reprice the entire request once the prompt crosses a token
threshold, and a flat Cost4 could not express it — so every request billed at
the short rate, including the long ones, which are the expensive ones.
The threshold reads raw usage.inputTokens, not normalized billable input: a
280k prompt with a 200k cache read has 80k billable input and still crosses
OpenAI's 272k boundary. Deciding after normalization would have under-billed
exactly the cache-heavy long requests.
Long context and Fast are mutually exclusive, not composable. OpenAI does not
serve long context in Fast mode, so exclusivity keys on the response-confirmed
tier: a >272k request merely tagged priority was necessarily downgraded and
bills long. That needed tier provenance at all four estimator call sites
instead of the collapsed scalar.
Also adds base prices for the three -pro virtual aliases, which resolved to
null and rendered no cost estimate at all.
Fixes#908
// base model's standard rate per the official Billing FAQ).
78
82
{provider: "google-antigravity",modelId: "gemini-3.6-flash",cost4: GEMINI_36_FLASH,source: `collapsed base ID ${GEMINI_PRICING}`,verifiedAt: "2026-07-22",status: "verified"},
79
83
{provider: "google-antigravity",modelId: "gemini-3.1-pro",cost4: GEMINI_31_PRO,source: `collapsed base ID ${GEMINI_PRICING}`,verifiedAt: "2026-07-22",status: "verified"},
84
+
// OpenAI GPT-5.6 `-pro` virtual selections. The virtual resolver keeps the SELECTED id in
85
+
// the usage log and records the wire model separately, and cost resolution deliberately
86
+
// does not fall back through resolvedModel — so without these rows every `-pro` request
87
+
// resolved to null and rendered no cost estimate at all (#908 audit, runtime-verified).
88
+
// Pro reasoning bills at the base model's published API rate; the suffix is an effort knob.
89
+
{provider: "openai-apikey",modelId: "gpt-5.6-sol-pro",cost4: GPT56_SOL,source: `collapsed base ID ${OPENAI_GPT56_PRICING}`,verifiedAt: "2026-08-03",status: "verified-derived"},
90
+
{provider: "openai-apikey",modelId: "gpt-5.6-terra-pro",cost4: GPT56_TERRA,source: `collapsed base ID ${OPENAI_GPT56_PRICING}`,verifiedAt: "2026-08-03",status: "verified-derived"},
91
+
{provider: "openai-apikey",modelId: "gpt-5.6-luna-pro",cost4: GPT56_LUNA,source: `collapsed base ID ${OPENAI_GPT56_PRICING}`,verifiedAt: "2026-08-03",status: "verified-derived"},
{provider: "google-antigravity",modelId: "gemini-pro-agent",cost4: GEMINI_31_PRO,source: `wire id for gemini-3.1-pro high ${GEMINI_PRICING}`,verifiedAt: "2026-07-23",status: "verified-derived"},
0 commit comments