docs/model-pricing.md
CodexBar has an additive models.dev pricing pipeline for future cost lookup work. Existing hardcoded pricing remains unchanged for now.
https://models.dev/api.json~/Library/Caches/CodexBar/model-pricing/models-dev-v1.jsonThe pipeline lets future scanner code read the last valid cache synchronously with ModelsDevPricingPipeline.lookup and refresh stale metadata separately with ModelsDevPricingPipeline.refreshIfNeeded. If a refresh fails, the last valid cache remains usable.
Pricing is scoped by provider id and model id. This prevents two providers with the same model id or display name from sharing pricing accidentally.
Planned local source mapping:
openaianthropicgoogle-vertex-anthropicThe first integration PR only adds the parser, client, cache, provider-scoped lookup, and tests. It does not route live cost calculations through models.dev yet.
models.dev publishes costs as USD per 1M tokens. CodexBar converts those to USD per token in the metadata layer:
perToken = modelsDevCost / 1_000_000
When models.dev includes cost.context_over_200k, CodexBar parses those values as the above-200k-token pricing lane and converts them with the same per-1M-token rule.