News for hackers. Stuff that matters.

Show HN: Slash-tokens – know LLM cost before the call leaves your machine

https://github.com/Wolfe-Jam/slash-tokens

I kept finding out what a call cost after I had already paid, so I built /Slash -- slash-tokens is a 4.8KB WASM that estimates tokens FAST and can block a wasted trip, or switch to cheaper same-provider model before the request leaves your machine. Try it MIT, no account needed: bunx slash-tokens

Or install the SDK: npm install slash-tokens

( 4 comments | 2 points | on HN )
Re:Show HN: Slash-tokens – know LLM cost before the call lea... by ramon156 on Tuesday August 25, 2026 @07:09PM (#49441936)
good thing you replaced emdashes with double dashes, i almost thought this was AI generated /s
Re:Show HN: Slash-tokens – know LLM cost before the call lea... by wolfejam on Tuesday August 25, 2026 @07:43PM (#49442265)
haha! they were on typewriters long before models!
Re:Show HN: Slash-tokens – know LLM cost before the call lea... by chrism238 on Wednesday August 26, 2026 @01:27AM (#49444365)
Move over Halting Problem!
Re:Show HN: Slash-tokens – know LLM cost before the call lea... by brownbear7 on Saturday August 29, 2026 @09:39AM (#49489843)
How do you handle cached input or long-context pricing? Some providers change the rate a lot depending on that, so I’m curious how accurate the estimate stays.