# Vendored pricing snapshots

Model prices used to cost sessions, one JSON file per provider, copied from
the Portkey pricing dataset (re-indented with sorted keys, so re-vendoring
produces a readable diff):

    https://configs.portkey.ai/pricing/<provider>.json

These files are the **fallback**. At costing time `spens.pricing` prefers a
live copy (cached under `~/.cache/spens/pricing` for 24h) and only reads a
snapshot from here when the fetch fails, the host is offline, or live
fetching is switched off (`SPENS_PRICING_OFFLINE=1`, or
`"pricing": {"live_fetch": false}` in `.spens.config.json`). If a provider
has no snapshot here and no cache, its models fall back to the built-in
`MODEL_PRICING` table in `spens/summarizer.py`, and anything missing from
that is costed at $0 rather than guessed.

To refresh the snapshots (needs network access, writes into this directory,
so run it from a checkout):

    spens pricing --vendor

Then commit whatever changed. `spens pricing` on its own reports where each
provider's data is currently coming from, and `spens pricing --refresh`
updates only the cache.

Prices in these files are **per 100 tokens** — see the unit note in
`spens/pricing.py`. `spens pricing --vendor` re-checks that convention
against published prices for a known model and warns if it no longer holds.
