docs/model-pricing.md
CodexBar uses models.dev as an additive pricing source alongside bundled fallback rates.
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.
Local cost scanners preserve that scope when selecting a catalog:
openai; approved provider-qualified routes stay on their route, and unknown prefixes remain unpriced.google-vertex-anthropicmodels.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.