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

# The Token Price Index

> What the OTPI is, how it's computed per lab, how to read the daily settled values, and every parameter the endpoint accepts.

The **Ornn Token Price Index (OTPI)** is a daily, volume-weighted blended price per million tokens for each major AI model lab. It lets you track the effective cost of inference across a lab's mix of production models in one number, rather than tracking each model's list price by hand.

## What the OTPI value means

`indexPerMtok` is the **blended USD price per million tokens** for a lab on a given day. It is a volume-weighted blend across the lab's paid production models, so higher-volume models and providers influence the value more.

For example, an `anthropic` OTPI of `1.00` means \$1.00 per million tokens averaged across paid Anthropic inference for that day.

<Note>
  The OTPI uses paid inference activity and provider-weighted posted pricing, not a simple unweighted list price. Treat `indexPerMtok` as a market-blended cost of serving a lab's mix of paid models on a given day.
</Note>

## How it's computed

For each lab, on each settlement day, the index is a **volume-weighted** blend of posted per-token prices across that lab's paid production models — effectively the price of the average paid token served for that lab that day. Free tiers and open-weight self-hosting are excluded, and models served in higher volume move the index more than thinly-used ones.

<Note>
  The exact weighting scheme and provider-sampling methodology are maintained by the OTPI team and refined over time. This page describes the current published behavior; if you need the precise formula or a methodology version for research use, contact the team rather than inferring it from values.
</Note>

## Tracked labs

The index is published for these labs:

`anthropic` · `openai` · `google` · `deepseek` · `minimax` · `xiaomi` · `qwen` · `moonshotai` · `z-ai` · `mistralai` · `meta-llama`

Fetch this list programmatically from [`GET /api/token-types`](/docs/api-reference/token-prices/list-tracked-otpi-labs), or the free-tier subset from [`GET /api/token-types-free`](/docs/api-reference/token-prices/list-free-tier-otpi-labs).

Open-weight models (for example `gpt-oss`, `gemma`) and free tiers are excluded. Models without enough pricing coverage on the settlement day are also excluded, so a lab having a light-coverage day is dropped rather than published with a partial blend.

## Update frequency and settlement

OTPI values are **settled daily**, a short time after the day they cover. The lag is deliberate: it lets the day's activity finish landing before the day is blended and frozen. Once a day is settled its `indexPerMtok` is stable.

Each row includes:

| Field          | Meaning                                             |
| -------------- | --------------------------------------------------- |
| `date`         | The settlement date (`YYYY-MM-DD`) the value covers |
| `lab`          | One of the tracked labs above                       |
| `indexPerMtok` | Blended USD price per million tokens for that lab   |
| `computedAt`   | UTC timestamp the value was computed                |

<Note>
  `indexPerMtok` is returned at full floating-point precision (for example `1.234567`), not pre-rounded. Round in your own presentation layer to whatever precision you display.
</Note>

## Parameters

The OTPI is served from a single endpoint, `GET /api/otpi`. Without a key, the free tier covers the four public labs — `anthropic`, `openai`, `google`, `deepseek` — for the trailing 1 month; the other labs and older history require an API key. See [Authentication](/docs/authentication).

| Parameter   | Type         | Description                                                                                                                          |
| ----------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `date`      | `YYYY-MM-DD` | Return that single settlement day. Defaults to the latest settled day when omitted. Ignored when `startDate`/`endDate` are supplied. |
| `startDate` | `YYYY-MM-DD` | Inclusive start of a settlement-date range. Use together with `endDate`.                                                             |
| `endDate`   | `YYYY-MM-DD` | Inclusive end of a settlement-date range. Use together with `startDate`.                                                             |
| `lab`       | enum         | Filter to a single lab. One of the tracked labs. An unrecognized value returns `400`.                                                |

Notes on combining parameters:

* **Latest vs. specific vs. range.** With no date parameters you get the latest settled day. Pass `date` for one historical day, or `startDate`+`endDate` for a window. Do not combine `date` with `startDate`/`endDate` — the API returns `400` if both are present.
* **`lab` is optional everywhere.** Omit it to get every lab you have access to (the free-4 without a key, or all tracked labs with one) for the selected day(s); include it to get one lab's series.

## Reading the latest values

Omit `date` to get the latest settled day across the labs you have access to (the free-4 without a key, or all tracked labs with one):

```bash theme={null}
curl "https://api.ornnai.com/api/otpi"
```

Add `lab` to get just one lab's latest value:

```bash theme={null}
curl "https://api.ornnai.com/api/otpi?lab=anthropic"
```

Pass a specific `date` to pull one historical day:

```bash theme={null}
DATE=$(python3 -c 'from datetime import date, timedelta; print((date.today() - timedelta(days=7)).isoformat())')
curl "https://api.ornnai.com/api/otpi?date=${DATE}"
```

## Pulling a historical range

To chart the index over time, pass `startDate` and `endDate` (both inclusive, `YYYY-MM-DD`) instead of `date`. Combine with `lab` to limit the response to a single lab. Anonymous callers are clamped to the trailing 1 month; pass an API key to reach further back. Compute dates when you make the request so a no-key example stays inside the moving window:

```python theme={null}
from datetime import date, timedelta
import requests

end_date = date.today()
start_date = end_date - timedelta(days=7)
resp = requests.get(
    "https://api.ornnai.com/api/otpi",
    params={
        "lab": "deepseek",
        "startDate": start_date.isoformat(),
        "endDate": end_date.isoformat(),
    },
)
resp.raise_for_status()
print(resp.json())
```

A ranged response echoes the requested window back as top-level `startDate`/`endDate` (not `date`), and `data` holds one row per settled day for the selected lab, oldest first.

A single-day query (`date`, or no date at all) instead echoes back a top-level `date`. The top-level `startDate`/`endDate` echo the window you requested, while the `data` rows begin at the first day the lab actually has coverage in that window, so the earliest row can be later than the `startDate` you asked for.

## Loading into pandas

The OTPI range response drops straight into a DataFrame for charting or analysis:

```python theme={null}
from datetime import date, timedelta

import pandas as pd
import requests

end_date = date.today()
start_date = end_date - timedelta(days=7)
resp = requests.get(
    "https://api.ornnai.com/api/otpi",
    params={
        "lab": "deepseek",
        "startDate": start_date.isoformat(),
        "endDate": end_date.isoformat(),
    },
)
df = pd.DataFrame(resp.json()["data"])
df["date"] = pd.to_datetime(df["date"])
df = df.set_index("date").sort_index()

# blended $/Mtok series for the lab, ready to plot
print(df["indexPerMtok"])
```

See the [pandas guide](/docs/pandas-dataframe) for the same pattern applied to the GPU index.

## Coverage and caveats

* **New labs backfill from their first settlement.** Newly added labs return rows only after their first public settlement. Historical ranges that start before that date will include only the labs already published then, so a range's per-day `count` can grow over time.
* **Light-coverage days are omitted, not zeroed.** A lab with insufficient same-day pricing coverage is dropped from that day rather than published with a partial or misleading value.
* **Settled values are stable; the latest day can shift.** Because settlement lands a short time after the covered day, the "latest" day advances daily. Pin to a specific `date` if you need a fixed value.

See the [OTPI API reference](/docs/api-reference/token-prices/get-the-latest-token-price-index-by-lab) for the full schema and code samples in every supported language.

For the companion index that prices the **request** rather than the token, see the [Workload Cost Index](/docs/workload-cost-index).
