Skip to content

Pricing sources

Gluon’s own cost and context figures are calculated from price and window tables that Gluon builds on your machine. No built table ships in the repository or in a release; the one hand-written table below is the exception. The harnesses’ own reports only audit the figures.

Table Where it comes from Built by
modelsdev.json The public models.dev catalog (https://models.dev/api.json): prices and context limits for the models Gluon offers and every priced model of the providers OpenCode uses. Each openrouter/* price is OpenRouter’s own (https://openrouter.ai/api/v1/models and the per-model /endpoints, what OpenRouter bills); models.dev’s row is kept beside it where they differ. src/cost/modelsdev-catalog.ts
claude-catalog.json The installed Claude Code binary alone, read as bytes and never run: its model catalog and the fast-mode rows of its price function. Anthropic’s published catalog has no prices. src/cost/claude-catalog.ts
codex-windows.json The installed Codex: codex debug models (no model is called). src/cost/codex-catalog.ts
grok-models.json The model list embedded in the installed Grok Build binary, read as bytes. Its prices are a marked seed from models.dev. A model the binary lacks gets the window of the observed table below, else none. src/cost/grok-catalog.ts
grok-observed-windows.json The only table in the repository: a window Grok showed for a model its binary does not list yet, with the evidence. Written by hand. by hand
  • At Gluon’s start, in the background (the first screen never waits for it): the models.dev catalog and OpenRouter’s listing with the endpoints of the models Gluon offers on it.
  • At each harness launch, in the background: the launched harness’s own table, read from its installed binary (again only when the binary’s version changes), the network tables when the last refresh is more than 10 minutes old, and the launched openrouter/* model’s row.
  • On demand: gluon pricing update runs the same refresh in the foreground and prints what it wrote.

The calls to models.dev and OpenRouter are plain unauthenticated requests, with a timeout and a size cap. They cannot be turned off. Offline, or when a source fails, Gluon keeps the last stored table, whatever its age. A session launched before any table exists is priced when the tables land, and a session keeps the tables it was priced with.

In <state>/gluon/tables/, one file per table, in a private directory. Every table is checked against an allowlist of keys and shapes before it is read or kept; one that fails is refused. A large move is not: when more than 15% of a table’s prices change, one price moves more than 3x or a model disappears, Gluon takes the table and logs the move in the audit ledger. gluon uninstall removes the directory.

gluon cost-report lists each table with its source, date, when it was fetched, how many requests it priced and the refreshes that changed it.