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

> ## Agent Instructions
> To act on Atlan objects, use the Atlan MCP server at https://api.atlan.com/mcp or the SDK. To install or publish skills from a terminal, use the `aireg` CLI; `aireg --map json` prints its command map. The `atlanai` CLI is deprecated. Run a read-only identity check before any write.
> The docs MCP server at /mcp searches these docs only. It cannot read or change Atlan objects.
> SDK packages: Python `atlanai` (PyPI) and TypeScript `@atlanai/sdk` (npm). Show Python first, then TypeScript.
> These docs cover Atlan AI Registry, Atlan's hosted product. The AI registry specification and aireg CLI are maintained separately. /open-source lists publicly reachable signed installers and explains that the source repository and hosted CLI reference currently require GitHub access. Do not claim the repository or its reference docs are publicly accessible. Use these docs for Atlan-specific setup such as the adapter, sign-in and workspaces.

# How cost is calculated

> How Atlan prices each model call in a trace: the formula, which rate wins, how cached and reasoning tokens count, and what Unpriced means.

Run cost is the sum of the costs of the model calls recorded in a run's trace. Atlan prices each call when it processes the trace, from the call's token counts and the rates that apply to its model and workspace. The cost is then fixed: changing a rate later does not reprice existing runs.

## The formula

For each model call, with rates in USD per million tokens:

```text theme={null}
cost = ( fresh input tokens  × input rate
       + cache read tokens   × cache read rate
       + cache write tokens  × cache write rate
       + output tokens       × output rate ) / 1,000,000
       + per-request price, when the model's price has one
```

A call is priced when its span has a model name and at least one input, output, cache-read, or cache-write token. Spans without a model or tokens are not priced from rates. See [Trace attributes](/registry/traces/references/attributes) for the keys Atlan reads.

## Which rate applies

Atlan resolves rates in two steps: first which model record prices the call, then where each of its four rates comes from.

```mermaid theme={null}
flowchart TD
  A["Model call with model name and tokens"] --> B{"Model configured in the trace's workspace?"}
  B -- Yes --> R["Use that model's rates"]
  B -- No --> C{"Model configured in the organization's default workspace?"}
  C -- Yes --> R
  C -- No --> D{"Public list price known for the name?"}
  D -- Yes --> L["List-price estimate"]
  D -- No --> U["Unpriced: cost 0"]
```

Atlan matches the requested model name first, then the model the provider reported. For a configured model, each of the four rates resolves on its own. The first source that applies wins:

| Price from | Meaning |
| - | - |
| **Negotiated** | An organization admin entered this rate. **Negotiated · partial** means some rates were entered and the rest come from the rows below. |
| **Seller discount** | The public list price minus the discount set for the model's seller in that workspace. |
| **List price** | The public list price, used when no rate is entered and no discount above 0% is set. |
| **Unpriced** | No public list price exists for this model and no rate was entered. |

**List price unavailable** in **Models & rates** means the public price could not be looked up at that moment. Every member can view rates; only an organization **Admin** can change them. See [Set model rates](/admin/finops/models-and-rates).

When a model has no public list price and you enter only an input rate, its cache reads and writes are priced at that input rate rather than at zero.

## How tokens are counted

* **Fresh input** excludes tokens read from or written to the cache. Most producers report the whole prompt as input, cached tokens included, so Atlan subtracts the cache-read and cache-write counts before pricing. Cached tokens are never charged twice.
* **Cache reads and writes** have their own rates. A run that reads a large cache can show a low cost beside a high token count.
* **Reasoning tokens** are part of the output count. They are priced as output once, not added again.
* **Long prompts**: when a model's price has context tiers, a prompt whose fresh input, cache reads, and cache writes together exceed a tier's threshold uses all four of that tier's rates.

## Worked example

These rates are illustrative, in the shape Atlan uses for a chat model: input $3.00, output $15.00, cache read $0.30, and cache write $3.75 per million tokens.

One model call reports a prompt of 12,000 tokens, of which 8,000 were read from the cache and 1,000 written to it, and 600 output tokens, of which 200 were reasoning.

| Token class | Tokens | Rate (USD per 1M) | Cost (USD) |
| - | -: | -: | -: |
| Fresh input (12,000 − 8,000 − 1,000) | 3,000 | 3.00 | 0.009000 |
| Cache read | 8,000 | 0.30 | 0.002400 |
| Cache write | 1,000 | 3.75 | 0.003750 |
| Output (includes 200 reasoning) | 600 | 15.00 | 0.009000 |
| **Total** | | | **0.024150** |

The same call at other price sources:

| Price from | Rates used | Cost (USD) |
| - | - | -: |
| **List price** | As above | 0.024150 |
| **Seller discount** of 20% | Every rate × 0.8 | 0.019320 |
| **Negotiated · partial**: input entered at \$2.50, 20% seller discount | Input \$2.50; the other three × 0.8 | 0.019620 |

If the 12,000-token prompt were charged entirely as fresh input, the input line alone would be \$0.036, which is why the cache split matters.

## Unpriced and missing costs

* **Unpriced** means Atlan looked for a rate and found none. The call's cost is recorded as zero and labelled unpriced. It is not evidence that the call was free.
* **A cost your code recorded** on a span is replaced when Atlan prices the call. When Atlan finds no rate, the call is unpriced at zero, even if your code recorded a cost.
* **If the rate lookup fails**, the batch keeps the cost its producer recorded, if any.
* **Spans without a model or token counts** keep whatever cost the producer recorded. Without one, they have no cost.

Through the API, read a span with `fields=cost` to see where its cost came from in `cost.source`:

| `cost.source` | Meaning |
| - | - |
| `artifact` | A configured model's rates, with at least one entered rate |
| `artifact_discount` | A configured model's list price minus its seller discount |
| `sheet` | A configured model's public list price |
| `sheet_by_name` | A public list-price estimate for a model name that is not configured |
| `unpriced` | No rate found; cost is zero |
| `attributes` | The cost the producer recorded, kept as sent |
| `none` | Not priced, and no cost was recorded |

## Model Gateway and trace cost

Model Gateway prices each call it serves with the same rules: the same entered rates, seller discounts, and list prices. Its usage views count the calls the gateway served. FinOps reports count the model calls recorded in your traces. The two are separate records, so do not add them together. They can differ when:

* A call goes through Model Gateway but your agent does not trace it. It appears only in Model Gateway usage.
* A call goes straight to a provider and is traced. It appears only in traces.
* The workspaces differ. Model Gateway records a call in the workspace of the model that served it. Trace pricing uses the trace's workspace, then the organization's default workspace.

## Related

* [Set model rates](/admin/finops/models-and-rates): Enter negotiated rates and seller discounts.
* [Usage and cost measures](/finops/references/measures): How reports total and average these costs.
* [Investigate agent cost](/finops/how-tos/investigate-cost): Follow a spend increase to the runs and rates behind it.
* [Trace attributes](/registry/traces/references/attributes): The model, token, and cost keys Atlan reads.


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