> ## Documentation Index
> Fetch the complete documentation index at: https://openlayer.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LLM cost estimation

> Learn how Openlayer estimates the costs associated with your LLM calls

Openlayer estimates the cost of the LLM calls it traces, so you can see what a request, a
session, or a day of production traffic costs without pricing each call yourself. The same
token prices cost the calls Openlayer makes on your behalf, for
[AI features](/docs/monitoring/ai-summaries) and for LLM-as-a-judge tests.

## How the estimate is computed

When you trace your AI system with one of Openlayer's [SDK
integrations](/docs/monitoring/instrument), every LLM call records the **prompt and completion
tokens** it used, along with the provider and model that served it. Openlayer multiplies
those token counts by the price it has for that provider and model pair.

When Openlayer has no price for the pair, the call is estimated at `$0`. Add or override
the price in workspace settings, and the traces that follow pick it up.

## Where the default prices come from

Default prices come from the [Openlayer LLM Cost
Tracker](https://llm-costs.openlayer.com/), a public service that publishes per-token
pricing for models across providers and refreshes daily. The service is [open
source](https://github.com/openlayer-ai/llm-cost-service): it fetches cost data from
sources such as OpenRouter and LiteLLM every day and serves it from a REST API you are free
to query yourself, with `GET /v1/costs` returning the full table.

Openlayer pulls the catalog from that service once a day, so the prices in your workspace
track the ones published on the site. If a pull fails, the prices already in your
workspace stay in place until the next one succeeds.

<Info>
  If you self-host Openlayer and would rather not fetch prices from an external
  service, you do not have to. Openlayer bakes a snapshot of the cost table into
  the Docker image at build time, so every image you receive carries a table
  that is current as of the image build. Prices then stay at that snapshot
  unless the deployment can reach the cost service, or you override them in
  workspace settings.
</Info>

## View the prices your workspace uses

Go to **Workspace settings** → **LLM costs**, listed after **AI features**. The table holds
the default token prices used to estimate LLM cost, plus any overrides for the workspace.
All prices are in **USD per 1 million tokens**, shown with a `/Mtok` suffix.

The columns are:

* **Model** — the model name, with its provider underneath.
* **Input** — the price per 1 million input tokens.
* **Output** — the same, for output tokens.
* **Updated** — when an override was last changed. Catalog defaults show an em dash.

An info sign beside an input or output price marks a workspace override: its tooltip gives
the catalog default the override replaced, or reads **Custom model without a default
price** for a model that exists only in your workspace.

Overrides sort to the top of the table, and the remaining rows sort by provider and then
model. Find a row with the **Search models...** box, or narrow the table by **Provider**,
**Pricing**, **Input**, and **Output**. When
nothing matches, the table shows **No model costs**.

Viewing the table only requires access to the workspace. **Add model**, **Edit**, and
**Revert to default** require permission to update it.

## Override a price

Override a price when the catalog value does not match what you pay:

<Steps>
  <Step title="Open the row's menu">
    Open the **Cost options** menu at the end of the row and click **Edit**.
    Hovering an input or output price and selecting the **Edit cost** icon opens
    the same form.
  </Step>

  <Step title="Set the new prices">
    In **Edit model cost**, fill in the input and output prices. The provider
    and model are fixed.
  </Step>

  <Step title="Save">
    Click **Save override**. The row shows the date you saved it, and an info
    sign beside each price you changed.
  </Step>
</Steps>

Overrides apply to the cost estimates of future traces for that provider and model.

## Add a model Openlayer does not price

Providers with flexible deployments, such as Azure OpenAI and Bedrock, report a deployment
name that may not match any model in the catalog. Click **Add model** and price it
yourself in **Add model cost**:

* **Provider** — pick one from the searchable list, or add your own.
* **Model** — the name as it reaches Openlayer, for example `my-gpt4-deployment`.
* **Input** and **Output** — each labeled `$ / 1M tokens`.
* **Additional token categories**, a collapsible section for token types you price
  separately, such as cached or reasoning tokens.

## Revert to the default

**Revert to default**, in the row's **Cost options** menu, removes an override. If a
default exists for that provider and model, it is restored; otherwise the model drops out
of the table. Future traces are estimated with the restored default, or with no price when
there is none.

<Note>
  If a model is still estimated at `$0` and you cannot price it yourself, [reach
  out](mailto:support@openlayer.com) with the provider and model name so it can
  be added to the catalog.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.