Skip to content

Refresh OpenAI pricing and support context/service-tier rates #86

Open

Description

@NOirBRight

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 is null.

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, and gpt-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

Relevant code

  • src-tauri/src/models.rs
  • src-tauri/src/gateway/telemetry.rs

Activity

  1. added
    bugSomething isn't working
    needs-triageMaintainer needs to evaluate this issue
    on Jul 12, 2026
  2. NOirBRight commented on Jul 12, 2026

    @NOirBRight
    OwnerAuthor

    Related follow-up Issues: #87 covers partial pricing coverage in the UI; #88 covers subscription/non-token billing semantics.

  3. added
    ready-for-agentFully specified, ready for an AFK agent
    and removed
    needs-triageMaintainer needs to evaluate this issue
    on Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agentwayfinder:taskWayfinder implementation task

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions