Metadata-Version: 2.5
Name: llm-prices
Version: 1.3.0
Summary: Dated, source-cited LLM API prices (Anthropic, OpenAI, Gemini, DeepSeek, Mistral, xAI, Groq, Together, Fireworks, Cohere) per 1M tokens, with provider-aware model-id lookup and exact decimal costs. Zero dependencies.
Project-URL: Homepage, https://github.com/Mattbusel/llm-prices
Project-URL: Source, https://github.com/Mattbusel/llm-prices/tree/main/python
Project-URL: Changelog, https://github.com/Mattbusel/llm-prices/blob/main/python/CHANGELOG.md
Project-URL: Issues, https://github.com/Mattbusel/llm-prices/issues
Author: Matthew Busel
License-Expression: MIT
License-File: LICENSE
Keywords: anthropic,cost,gemini,llm,openai,pricing,tokens
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# llm-prices

Dated, source-cited LLM API prices for Python: the same table as the Rust crate
[`llm-prices`](https://crates.io/crates/llm-prices), generated from
[`prices.json`](https://github.com/Mattbusel/llm-prices/blob/main/prices.json). Pure Python, no
dependencies, no network access. Prices are USD per 1M tokens, and every row carries the
provider's pricing page and the date it was checked.

```python
import llm_prices
from llm_prices import Usage

p = llm_prices.lookup("claude-sonnet-4-6")          # also dated, Bedrock, Vertex, prefixed ids
groq = llm_prices.lookup_provider("groq", "openai/gpt-oss-120b")

usage = Usage(input=2_048, cache_read=45_000, cache_write_5m=3_500, output=1_024)
p.cost_usage(usage).total                 # 0.048129 (float)
p.cost_usage(usage, exact=True).total     # Decimal('0.048129')
```

`cost_usage` prices prompt-cache reads, cache writes by lifetime, batch discounts and the
long-context switch. Source and docs: https://github.com/Mattbusel/llm-prices
