# Price book management

**Last updated:** 2026-11-23T10:59:54-03:00 (UTC-3)

Edit the [manual price book](/docs/features/pricing/) from the console or the API, with a revision history and a revert to the YAML at any time. Flag: `price_book_management`, which requires `manual_price_catalog`, the UI and PostgreSQL.

## How it works

The YAML `price_book` is the baseline. Saving from the console writes an **override** of the YAML book to PostgreSQL, which takes precedence over the YAML until it is removed. The book in effect, YAML or override, wins over the automatic catalogs for every model it prices ([when the manual price is used](/docs/features/pricing/#when-the-manual-price-is-used)); remove an entry to return that model to its [automatic price](/docs/features/automatic-pricing/). Each save becomes a revision in the history.

The rules for each rate are the same as in the YAML: connection + exact upstream ID, USD per million text tokens as a decimal, RFC3339 effective date and an HTTPS source. Missing is not zero: a model without an entry keeps its automatic price, or stays unknown.

## How to use it

**In the console:** **Settings & sources**. The editor has one field per rate, 20 per page, adding, removing, saving everything at once and **Revert to YAML**.

- **Prepare revision** only fills in a draft; nothing changes until you save.
- If someone saved before you, your draft is kept for review. **Reload** discards it and shows the current state.

**Through the API:**

| Endpoint | What it does |
| --- | --- |
| `GET /api/v1/admin/price-book` | Version, source (YAML or override) and the rates in effect |
| `PUT /api/v1/admin/price-book` | Replaces the whole book: `{version, prices}`, up to 4 MiB and 10,000 rates. An empty list is an empty override |
| `DELETE /api/v1/admin/price-book` | `{version}`; reverts to the YAML. Different from saving an empty list |
| `GET /api/v1/admin/price-book/history` | Revisions, paginated by `before_version` and `limit` (1 to 100) |
| `GET /api/v1/admin/price-book/history/{version}` | The book as it was at that revision |

- **Who can:** the global admin edits (`prices:manage`); global admins and viewers read (`prices:read`). Operators and team roles cannot see it.
- Writes require a same-origin session, CSRF and the `version` that was read, and are recorded in the audit log with the actor and the request ID.
- An unavailable database blocks reading and editing; inference continues with the last valid configuration.

## History

- The history only grows: there is no API to edit or delete revisions.
- Numbering follows the global configuration version and can have gaps.
- A revert's revision stores the YAML at that moment. Later changes to the YAML or the automatic catalogs do not enter the history.
- A database administrator can still change the data: the history is not tamper-proof storage.

## Limits

- Turning off `price_book_management` does not delete revisions or the saved override; whether the manual price is used is decided by `manual_price_catalog`.
- Reference price: it does not generate spend, budget or invoices, and it does not reprice past events.
- When you go back to a gateway version without this management, the overrides are ignored and the YAML applies. Before that, copy the rates you want to keep into the YAML.

## See also

- [Manual price book](/docs/features/pricing/).
- [Automatic pricing](/docs/features/automatic-pricing/).
- [Configuration parity](/docs/reference/configuration-parity/).


## Price data versus parameter defaults

A price-book entry is identified advisory data with an effective date, model/provider identity and source. It has no fabricated global price default. Shared [parameter definitions](/docs/reference/parameter-registry/) preserve its existing numeric and reference validation without approving enforcement prices, changing historical events or authorizing a model capability. The managed writer retains its version, audit and whole-snapshot checks.
