Repository navigation
Refresh OpenAI pricing and support context/service-tier rates #86
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agentwayfinder:taskWayfinder implementation taskWayfinder implementation task
Description
Summary
Gateway cost estimation uses stale and incomplete OpenAI pricing metadata. New GPT-5.6 models have no pricing, while several GPT-5.5/GPT-5.4 constants do not match the current Standard short-context table and appear to mix Batch or long-context rates.
Live evidence
Observed through the running gateway_usage_snapshot:
- total tokens:
176,092,215; - total requests:
1,452; - requests missing model pricing:
1,448; - estimated cost:
$0.047209875; - recent 500-event sample: 497 requests used
openai/gpt-5.6-sol, whose runtime pricing metadata isnull.
Runtime metadata currently contains prices for gpt-5.4, gpt-5.4-mini, and gpt-5.5, but no prices for gpt-5.6-sol, gpt-5.6-terra, or gpt-5.6-luna.
Root cause
builtin_model_metadata() and OFFICIAL_FAST_PRICING are static. ModelPricing only contains one input, cached-input, and output rate per model. Current OpenAI pricing also varies by short/long context and Standard/Batch/Flex/Priority processing, with cache-write pricing for applicable models.
Expected behavior
- Pricing matches the current official OpenAI source.
- Estimation selects the rate for the actual service tier and context band.
- Unknown tiers or missing data remain unpriced.
- Source URL and retrieval/version timestamp are visible in metadata.
Acceptance criteria
- Add current pricing for
gpt-5.6-sol,gpt-5.6-terra, andgpt-5.6-luna. - Reconcile GPT-5.5, GPT-5.4, and GPT-5.4-mini with current Standard pricing.
- Represent short/long-context rates where applicable.
- Represent Standard, Batch, Flex, and Priority separately, or limit estimation to the observed tier.
- Record enough telemetry to select the correct tier; fail to unknown when unavailable.
- Do not treat Fast/Priority aliases as Standard traffic.
- Add table-driven tests for aliases, context threshold, cache input, output, and tiers.
- Add a documented update/check procedure for newly discovered official models.
Primary references
- https://developers.openai.com/api/docs/pricing
- https://developers.openai.com/api/docs/guides/latest-model.md
Relevant code
src-tauri/src/models.rssrc-tauri/src/gateway/telemetry.rs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agentwayfinder:taskWayfinder implementation taskWayfinder implementation task
Activity
NOirBRight commentedon Jul 12, 2026
Related follow-up Issues: #87 covers partial pricing coverage in the UI; #88 covers subscription/non-token billing semantics.