vitna.ai/docs/api/v1/prices/sku-history Machine view
Raw .md llms.txt
> Source: https://vitna.ai/docs/api/v1/prices/sku-history
> Raw Markdown: https://vitna.ai/docs/api/v1/prices/sku-history.md
> Corpus index: https://vitna.ai/llms.txt

# Sku history

Every [price period](../../../concepts/price-period.md) recorded for one sku.

```
GET /api/v1/skus/{slug}/history
```

```bash
curl "https://vitna.ai/api/v1/skus/gpt-5-pro/history?dimension=input_per_mtok"
```

## Parameters

| Parameter | In | Meaning |
|---|---|---|
| `slug` | path | The sku slug, as it appears on the tape |
| `dimension` | query | Restrict to one meter. Optional. |

Omitting `dimension` returns periods across every dimension the sku carries. A
`dimension` the sku's class is not metered by answers `404 unknown_dimension`
rather than an empty history, which would read as a price never recorded.

## Response

```json
{
  "sku": { "slug": "gpt-5-pro", "name": "gpt-5-pro", "provider": "OpenAI", "class": "model", "attrs": {} },
  "periods": [
    { "dimension": "input_per_mtok", "amountUsd": 15, "unit": "USD per 1M tokens",
      "bandFromTokens": 0, "bandToTokens": null, "bandLabel": null,
      "since": "2026-08-07T00:00:00.000Z", "until": null, "confirmed": true, "flap": false,
      "confirmedObservationId": "412" }
  ],
  "meta": { "generatedAt": "...", "source": "database", "count": 1, "units": ["USD per 1M tokens"] }
}
```

The period with `until: null` is the current price, and its `since` is the
`since` the [tape](tape.md) prints for that meter. There is exactly one open
period per dimension and context band, enforced by a partial unique index.

## History needs the record

Price history accumulates in the database. The committed snapshot is a picture
of one moment and contains no history at all.

So an instance serving the snapshot answers `200` with the sku, an **empty**
`periods` array, `meta.source: "snapshot"`, and a `meta.note` saying that
history is held in the record.

It does not invent a single period out of the current price. That would look
exactly like a price that has never moved, which is a claim about the market
rather than about this instance.

`vitna.ai` serves the record, so this only affects local checkouts.

## Errors

| Status | Code | Cause |
|---|---|---|
| 404 | `unknown_sku` | No registered sku with that slug |
| 404 | `unknown_dimension` | The sku's class is not metered by that `dimension` |

## Caching

`public, max-age=60, stale-while-revalidate=3600`.
Human Machine Shift+M