tokencost
github.com · Package · Quiet
Python utility that estimates LLM costs for 400+ models
- Developer tools
- Package
- Python
- Day-7 check
- Day-30 check
- llm
- pricing
- token
- analytics
- claude
- large language model
- observability
- openai
- price
- price tracker
- Stars
- 2k
- Forks
- 110
- Open issues
- 19
- Last commit
- Releases
- 29
- Found
- 2 years ago
GitHub figures as of . They are context, not a ranking.
tokencost is a Python utility library that estimates the cost of LLM prompts and completions across more than 400 models. It counts tokens with each model's tokenizer and multiplies them by a stored price for that model, accounting for float precision; it helps developers estimate spending before bills arrive.
Repository description on GitHub: “Easy token price estimates for 400+ LLMs. TokenOps.”
What it does
- Counts tokens with each model's tokenizer and multiplies by stored prices
- Price estimates for more than 400 LLM models
- Accounts for float precision in cost calculations
Good for
- Estimate prompt and completion cost before the bill arrives
- Compare the cost of the same prompt across LLM models
Suits: Python developers tracking LLM API spending.
What you can try
Read the README on GitHub and install the Python package.
Install
pip install tokencostConfirmed against the package registry. Read the project’s own instructions before running anything.
Links go to third-party sites KipFound does not control. KipFound has not installed, audited or tested this software.
Found vs. released
Kip first saw tokencost on , when Areibman posted it to Show HN. The oldest published release on GitHub is 0.0.1, dated . tokencost had been shipping tagged releases for 174 days before it was found. 29 releases have been published in total; the latest is 0.1.26 ().
Day-7 and day-30 updates
Day 7 1 release shipped
- 1 release in the first 7 days: 0.1.11 (21 Jun 2024)
- Show HN discussion at check time: 268 points, 76 comments. API record
Checked , later than day 7 because tracking began after.
Day 30 1 release shipped
- 1 release in the first 30 days: 0.1.11 (21 Jun 2024)
- Show HN discussion at check time: 268 points, 76 comments. API record
Checked , later than day 30 because tracking began after.
Release timeline every entry links to its source
- Repository created on GitHub: AgentOps-AI/tokencost
- Release 0.0.1
- Found: Areibman posted it to Show HN. Show HN
- Release 0.1.21
- Release 0.1.22
- Release 0.1.23
- Release 0.1.24
- Release 0.1.25
- Release 0.1.26
- Day-7 check recorded by Kip (details)
- Day-30 check recorded by Kip (details)
Showing the first and the 6 latest of 29 releases. All releases on GitHub
Quick answers
- When was tokencost released?
- Its first tagged release on GitHub is dated 26 Dec 2023. Kip found it on Show HN on 17 Jun 2024.
- Is tokencost open source?
- Its source is public on GitHub at AgentOps-AI/tokencost under the MIT licence.
- What does tokencost run on?
- Library.
- Is tokencost free?
- It is open source, so the code is free to read and run; check the licence for terms.
- Is tokencost still maintained?
- It has had no commit or release for over a year as of the latest check.
Provenance
| Source | Record | Last checked |
|---|---|---|
| Show HN | listing official API record | |
| GitHub repository | AgentOps-AI/tokencost REST API record | |
| GitHub Releases | release list REST API record |
Stable ID hn-40710154. Summary written by KipFound’s editor.
Share
Similar tools
Made this, or spotted a mistake? Ask for a correction or removal. No account or email address needed.