To

Token price calculator for 400+ LLMs

Hacker News

Token price calculator for 400+ LLMs

Hey HN! Tokencost is a utility library for estimating LLM costs. There are hundreds of different models now, and they all have their own pricing schemes. It’s difficult to keep up with the pricing changes, and it’s even more difficult to estimate how much your prompts and completions will cost until you see the bill. Tokencost works by counting the number of tokens in prompt and completion messages and multiplying that number by the corresponding model cost. Under the hood, it’s really just a simple cost dictionary and some utility functions for getting the prices right. It also accounts for different tokenizers and float precision errors. Surprisingly, most model providers don't actually report how much you spend until your bills arrive. We built Tokencost internally at AgentOps to help users track agent spend, and we decided to open source it to help developers avoid nasty bills.

Share card

Actual performance

268points
76comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
76%76% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: agent, model, user · Missing: mac, agents, macos
62%62% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: open source, ide, io · Missing: https docs, excited, just released
55%55% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: users · Missing: mobile apps, ios, personal
47%47% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: users · Missing: plus, platform, intuitive
28%28% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
17%17% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Ea
Easy token counting and price calculation for LLMs50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Easy token counting and price calculation for LLMs

Hacker News3
On
OnPanda – Steer LLMs and agents at the token level63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

OnPanda – Steer LLMs and agents at the token level

Hacker News5
Solana Token Price Alert
Solana Token Price Alert28%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Checks an SPL token's USD price every 5 minutes via the publ

Indie Hackers
Th
The SC4-HSM is now a FIDO U2F token46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The SC4-HSM is now a FIDO U2F token

Hacker News3
Jw
Jwt.show – show the payload of a jwt token46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Jwt.show – show the payload of a jwt token

Hacker News1
Cr
CryptoTokens.wtf – Token Whitepapers from Highest Grossing ICOs42%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CryptoTokens.wtf – Token Whitepapers from Highest Grossing ICOs

Hacker News1
To
Token Thermodynamics52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Token Thermodynamics

Hacker News4
Pr
Price to Hours Worked Calculator54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Price to Hours Worked Calculator

Hacker News2
Te
Tether Indicative Price (TIP)49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Tether Indicative Price (TIP)

Hacker News4
Do
Dogecoin Average - the price of Doge57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Dogecoin Average - the price of Doge

Hacker News62