Repository navigation
Calendar versions, prices kept current, and the Anthropic prices corrected - #86
Merged
Merged
Conversation
- Versions are YYYY.M.PATCH. The next release is 2026.9.0 rather than 0.3.0; Cargo.toml, the changelog, CONTRIBUTING, the workflows and examples follow. The release workflow refuses a tag that is not a calendar version for the month it is pushed in. Compatibility is carried by a Breaking section in the changelog, since the number no longer says. - The shipped Anthropic book priced claude-opus-5 and claude-opus-4-8 at $15/$75 per million and claude-sonnet-5 at $3/$15; the rates are $5/$25 and $2/$10, with cache reads and writes to match. The book is anthropic-2026-09. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5yngL8AGNx2FZKffQTaAv
- Three sources, each overruling the one before: the shipped tables, a daily
sync from a public price list (LiteLLM's by default), and prices set by hand
per provider and model through the management API.
- The sync never touches the request path. A price that moves by more than
half is held for a person to accept or reject; a refused price is not held
again. A failed sync keeps the prices in place and says why.
- Rates can charge per picture, per second of audio and per million
characters, so image, speech and transcription models can be priced. A rate
whose unit nobody measured is unpriced, never zero.
- Every priced cost names the book edition that priced it, on the reply and on
its usage row. Schema version 5.
- Endpoints: GET /manage/prices, POST /manage/prices/sync,
POST /manage/prices/held/{vendor}/{model}, GET /manage/providers/{id}/prices,
PUT and DELETE /manage/providers/{id}/prices/{model}. /manage/status says
when prices last synced and how many are held.
- LLMR_PRICE_SYNC, LLMR_PRICE_SYNC_URL and LLMR_PRICE_SYNC_HOURS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J5yngL8AGNx2FZKffQTaAv
- `_above_1hr` prices Anthropic's one hour prompt cache and is not a context band. Reading it as one left every Anthropic row in the list unpriced. Only `_above_<N>k_tokens` marks a band now, and a test says which is which. - A dry run against the real list, kept as an ignored test, reads 181 rows for the three vendors, holds none, and matches every shipped row it covers. - Documented: the Prices section of MANAGEMENT.md, the new environment variables and the one outbound request, `book` on a cost, the design choice, the changelog, and the file tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5yngL8AGNx2FZKffQTaAv
prices.yml fetches the list every Monday and runs the sync's own comparison against the shipped books. Where they differ, it keeps one issue open with a table of each row, the shipped rate, the list's rate and what a sync would do; it closes the issue once they agree. An issue rather than a pull request: a book's verified_at says a person read the vendor's page, and a bot cannot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5yngL8AGNx2FZKffQTaAv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
1. Prices kept current (new)
llmr now takes a model's price from one of three sources. Each one overrides the one before it:
shippedmodels/*-prices.toml)anthropic-2026-09syncedsynced-2026-09-27manualmanual-2026-09-27The sync.
gpt-5.5above 272K) stay unpriced, the same as in the shipped tables. Anthropic's one-hour cache price (_above_1hr) is not treated as a band.openai-compatibleand self-hosted ones. A self-hosted model staysfreeuntil someone sets a price for it.Media units. Rates can now charge per picture, per second of audio, and per million characters, alongside the token rates. So image, speech and transcription models get priced.
unpriced, never zero.Units,PriceBook::price_with,PriceBook::new, andRate::tokenswithwith_image,with_audio_secondandwith_character.Book on every cost. Every priced cost names the price edition that priced it, as
bookinllmr_costand on each usage row. A later price change therefore never re-prices past requests.Endpoints.
GET /manage/prices: last sync, held prices, manual prices.POST /manage/prices/sync: sync now.POST /manage/prices/held/{vendor}/{model}with{"decision": "accept" | "reject"}.GET /manage/providers/{id}/prices: each model's rate and where it came from. Add?all=truefor every priced model.PUT/DELETE /manage/providers/{id}/prices/{model}: set or remove a manual price. Amounts must be decimal text; floats are refused./manage/statusgains apricesblock.Environment variables:
LLMR_PRICE_SYNC(offdisables it),LLMR_PRICE_SYNC_URL,LLMR_PRICE_SYNC_HOURS(default 24).Schema v5: new
synced_pricesandprice_overridestables, andprice_bookon usage rows. A v4 database is brought forward on start.2. Weekly drift check (
prices.yml)Every Monday the workflow compares the shipped price books with the list, using the sync's own code.
verified_atclaims that a person read the vendor's page.3. Calendar versions (
YYYY.M.PATCH)2026.9.0instead of0.3.0. 0.3.0 was never tagged.2026.9.0and2026.9.release.ymlrefuses a tag that is not a calendar version for the month it is pushed in.CHANGELOG.mdmerges everything unreleased into## Unreleased: 2026.9.0, with a Breaking section.4. The Anthropic price book was wrong
claude-opus-5claude-opus-4-8claude-sonnet-5anthropic-2026-09.Checks
cargo fmt --all -- --check, andcargo clippy -- -D warningsfor all features, no default features, and default.cargo test --all-features(450 passed) andcargo test(274 passed)._above_1hr, and the hold rules.raw.githubusercontent.comdirectly (the sandbox proxy is in the way). The code path is the same GET.prices.ymlworkflow itself, which runs only on schedule or dispatch. It can be triggered by hand after merge.🤖 Generated with Claude Code
https://claude.ai/code/session_01J5yngL8AGNx2FZKffQTaAv