> ## Documentation Index
> Fetch the complete documentation index at: https://gomodel-build-canonical-module-path.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost tracking

> How GoModel estimates request costs, where pricing comes from, how to override it, and how to recalculate stored costs.

GoModel estimates the cost of every tracked request from model pricing and shows the totals on the dashboard.

<Warning>
  These costs are **estimates**, not a billing record. GoModel computes them from
  catalog pricing and the token counts each provider reports, which can differ
  from a provider's own billing because of promotions, rounding, cache rules,
  currency conversion, or plan discounts. Treat the provider's dashboard as the
  source of truth and do not use GoModel figures for invoicing or reconciliation.
</Warning>

## How costs are estimated

For each request GoModel prices:

* **Input** and **output** tokens at the model's per-million-token (MTok) rates.
* **Cached input**, **reasoning**, and **audio** tokens at their own rates when the provider reports them, so cache-heavy and reasoning-heavy traffic is priced correctly.

When a provider returns an exact cost (OpenRouter credits, xAI `cost_in_usd_ticks`), GoModel uses that value instead of catalog pricing. Each row records which method was used in its `cost_source` field: `model_pricing`, `openrouter_credits`, or `xai_cost_in_usd_ticks`.

<Note>
  A cached-token discount only applies when the model's pricing includes a
  `cached_input_per_mtok` rate. If that rate is missing from the catalog, cached
  tokens are priced at the full input rate.
</Note>

## Where pricing comes from

Pricing for a model is resolved in priority order:

1. Operator **overrides** set in the dashboard.
2. **`config.yaml`** `providers.<name>.models` metadata.
3. The **model catalog**, sourced from the [`ai-model-list`](https://github.com/ENTERPILOT/ai-model-list) registry.

The catalog supplies the default pricing for most models. If a model's price looks wrong or a rate is missing (for example, a cached-input rate), check it against [`ai-model-list`](https://github.com/ENTERPILOT/ai-model-list) and contribute a correction there, or set an override for an immediate fix.

## Override pricing

Override pricing when the catalog price is wrong, missing, or differs from your negotiated rate. Open the **Models** page, find the model, and open its **Pricing override** editor. Set one or more price types (input, output, cached input, and so on) in USD. Saved fields override catalog and `config.yaml` pricing for that selector; unset fields keep inheriting.

<Frame caption="The Models page lists each model's prices; the $ action opens its pricing override">
  <img src="https://mintcdn.com/gomodel-build-canonical-module-path/cDiuvZtU5AlmEDf_/features/pricing-override-models.png?fit=max&auto=format&n=cDiuvZtU5AlmEDf_&q=85&s=ce6131d291bfc7331f3eb18e4281d334" alt="GoModel Models page listing registered models with input and output prices per MTok and a pricing override action on each row" width="1600" height="1014" data-path="features/pricing-override-models.png" />
</Frame>

<Frame caption="Set a price type and USD value; saved fields override catalog and config.yaml pricing for the selector">
  <img src="https://mintcdn.com/gomodel-build-canonical-module-path/cDiuvZtU5AlmEDf_/features/pricing-override-editor.png?fit=max&auto=format&n=cDiuvZtU5AlmEDf_&q=85&s=bdd8bcd18a6507e1c466d76b6ac9dbe2" alt="GoModel Pricing override editor showing the selector, an Input dollars-per-MTok price type, and its USD value" width="1600" height="1010" data-path="features/pricing-override-editor.png" />
</Frame>

Overrides apply to new requests. To re-cost requests that already ran, recalculate them.

## Dashboard totals

* **Estimated Cost** — spend on live provider requests; cache hits are excluded.
* **Saved Cost** — what requests served from the cache would otherwise have cost.

A `---` value means the cost is unknown because no pricing was available, which is not the same as `$0`.

## Recalculate stored costs

Recalculating recomputes the stored cost of matching usage rows from current pricing. Use it after changing an override, or when pricing was unavailable at the time a request ran. The action is enabled by default (`USAGE_PRICING_RECALCULATION_ENABLED`); on the usage view, choose **Recalculate**, then type `recalculate` to confirm. It is scoped to the selected date range, provider or model, and user path.

<Warning>
  Recalculation **overwrites** the cost fields of every matching row. If a row's
  model no longer resolves to any pricing, its cost is **cleared** rather than
  left unchanged, and the result reports how many rows still lack pricing. Token
  counts are never modified.
</Warning>
