Get started

Sku history

Source

Every price period recorded for one sku.

text
GET /api/v1/skus/{slug}/history
bash
curl "https://vitna.ai/api/v1/skus/gpt-5-pro/history?dimension=input_per_mtok"

Parameters

ParameterInMeaning
slugpathThe sku slug, as it appears on the tape
dimensionqueryRestrict 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 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

StatusCodeCause
404unknown_skuNo registered sku with that slug
404unknown_dimensionThe sku's class is not metered by that dimension

Caching

public, max-age=60, stale-while-revalidate=3600.