ai-serving-cost: Restate an AI API bill from tokens, rates, and cache share
An API bill is a token count times a rate, minus whatever the cache knocks off, plus a per-request floor. These functions compute that math directly: price a single request from its input and output tokens, price the cache discount at a given volume, and scale a per-request cost to a 30-day monthly bill. An audit can restate the invoice line by line instead of trusting the provider's summary.
Companion to Pastagi, which publishes AI cost audits and serving math. Five pure functions, no dependencies beyond base.
[Skip to Readme]
Downloads
- ai-serving-cost-0.1.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | base (>=4 && <5) [details] |
| License | MIT |
| Copyright | 2026 Poket Dev LLC |
| Author | Poket Dev |
| Maintainer | hello@poketdev.com |
| Uploaded | by PoketDev at 2026-11-02T02:54:10Z |
| Category | Math |
| Home page | https://pastagi.com |
| Bug tracker | https://github.com/scrapertweeter3-prog/ai-serving-cost-hs/issues |
| Source repo | head: git clone https://github.com/scrapertweeter3-prog/ai-serving-cost-hs |
| Distributions | |
| Downloads | 3 total (3 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2026-11-02 [all 1 reports] |