llm-price-tracker
llm-price-tracker fetches official published API token prices for major LLM
providers, normalises them into one schema, and supports JSON snapshots and
snapshot diffs.
Prices are collected from official provider pages only. Provider page structures can change without notice, so review fetched prices before using them for production billing or customer-facing estimates.
Supported providers
- OpenAI GPT API models: https://developers.openai.com/api/docs/pricing
- Anthropic Claude models: https://docs.anthropic.com/en/docs/about-claude/pricing
- Google Gemini models: https://ai.google.dev/gemini-api/docs/pricing
- Kimi / Moonshot AI models: https://platform.kimi.ai/docs/pricing/chat
- MiniMax models: https://platform.minimax.io/docs/guides/pricing-paygo
- Qwen / DashScope models: https://www.alibabacloud.com/help/en/model-studio/models
Installation
pip install llm-price-tracker
For local development:
python3 -m pip install -e ".[dev]"
Python 3.10 or newer is required.
Python usage
from llm_price_tracker import (
diff_snapshots,
fetch_all_prices,
fetch_provider_prices,
load_snapshot,
save_snapshot,
)
prices = fetch_all_prices()
openai_prices = fetch_provider_prices("openai")
save_snapshot(prices, "prices.json")
old = load_snapshot("prices-old.json")
new = load_snapshot("prices.json")
diff = diff_snapshots(old, new)
CLI usage
llm-price-tracker list-providers
llm-price-tracker fetch --provider openai --output openai-prices.json
llm-price-tracker fetch --provider all --output prices.json
llm-price-tracker diff --old prices-old.json --new prices.json
llm-price-tracker diff --old prices-old.json --new prices.json --fail-on-change
The CLI exits non-zero when fetching, parsing, validation, or diff
--fail-on-change checks fail. Use --ignore-errors with fetch --provider all
to write successful providers while reporting skipped provider errors.
Output schema
Snapshots are JSON arrays of ModelPrice objects. Decimal prices are serialized
as strings to avoid floating-point precision loss.
[
{
"provider": "openai",
"model": "gpt-4.1",
"input_per_1m": "2.00",
"output_per_1m": "8.00",
"cached_input_per_1m": "0.50",
"cache_write_5m_per_1m": null,
"cache_write_1h_per_1m": null,
"cache_storage_per_1m_hour": null,
"currency": "USD",
"unit": "1M tokens",
"source_url": "https://openai.com/api/pricing/",
"source_type": "html",
"fetched_at": "2026-06-12T09:00:00Z",
"modality": null,
"billing_tier": null,
"price_condition": null,
"notes": null
}
]
Some providers publish tiered or modality-specific prices. Those variants use
optional modality, billing_tier, and price_condition fields instead of
inventing new model names.
Provider adapters include lightweight required-model sanity checks for current official pages. Those checks are adapter arguments so downstream users can override them when providers rename, add, or deprecate models.
Development
python3 -m pip install -e ".[dev]"
pytest
ruff check .
black --check .
Normal tests use saved fixtures and do not call live provider pages. Live tests, when added, should be opt-in:
LLM_PRICE_TRACKER_LIVE_TESTS=1 pytest tests/live
Metadata
Release files for llm-price-tracker 2026.6.121346
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llm_price_tracker-2026.6.121346.tar.gz | 21.9 kB | Without provenance | Details for llm_price_tracker-2026.6.121346.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llm_price_tracker-2026.6.121346-py3-none-any.whl | Python 3 | none | any | Details for llm_price_tracker-2026.6.121346-py3-none-any.whl |
Total release size: 45.7 kB
Release files / llm_price_tracker-2026.6.121346.tar.gz
| Download URL | llm_price_tracker-2026.6.121346.tar.gz |
|---|---|
| Size | 21.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d5c5bbc4124368a73c30284f56e585b920d656429a2ebfe0e62f9c46585006c
|
|
BLAKE2b-256 checksum How to use checksums |
87bfe7a0ba7229cc0eb16cbf0c3eaf06267385d695802174bc4bb849c3fa3c59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / llm_price_tracker-2026.6.121346-py3-none-any.whl
| Download URL | llm_price_tracker-2026.6.121346-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b2c5a6177ce5ce25048fb74dde0abda085a5fd1df57ecbee5a4961e99374f33
|
|
BLAKE2b-256 checksum How to use checksums |
5cd844c17b6c09b0f9ad0e942e9606b0b30155e9ea6be2624f63663c0163756e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for llm-price-tracker 2026.6.121346
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.