Spaces:
Sleeping
Sleeping
Download scripts/lib/chat/pricing.py from defenestrate/asa: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/spaces/defenestrate/asa/resolve/main/scripts/lib/chat/pricing.py
- Command line
-
hf download hf://spaces/defenestrate/asa/scripts/lib/chat/pricing.py
-
curl -L -o pricing.py https://huggingface.co/spaces/defenestrate/asa/resolve/main/scripts/lib/chat/pricing.py
568 Bytes
| """Token pricing constants used by chat analytics and session-core planning.""" | |
| from __future__ import annotations | |
| # Pricing per token (USD), Anthropic public pricing as of 2026. | |
| # Sonnet 4.6: $3/M input, $15/M output. | |
| # Cache write costs 1.25x input for ephemeral 5-minute cache. | |
| # Cache read costs 0.10x input. Extended 1-hour cache writes cost 2.00x input. | |
| PRICE_SONNET_IN = 3.00 / 1_000_000 | |
| PRICE_SONNET_OUT = 15.00 / 1_000_000 | |
| PRICE_SONNET_CACHE_WRITE = 3.75 / 1_000_000 | |
| PRICE_SONNET_CACHE_READ = 0.30 / 1_000_000 | |
| PRICE_SONNET_CACHE_WRITE_1H = 6.00 / 1_000_000 | |