Show HN: Slash-tokens – know LLM cost before the call leaves your machine
Slash-tokens is a 4.8KB WASM library that estimates LLM token counts and costs client-side before a request is sent, available MIT-licensed via npm.
Slash-tokens, a client-side token estimation library, launched on Hacker News on August 25, 2026 under the Show HN tag. The tool estimates LLM call costs before a request leaves the user's machine, addressing a gap the author describes as learning what a call cost only after already paying for it.
The library ships as a 4.8KB WebAssembly module and can either block a request outright or automatically switch to a cheaper model within the same provider before the API call is made, per the GitHub repository. It is released under the MIT license and requires no account to use. Developers can try it immediately via bunx slash-tokens or install the SDK with npm install slash-tokens.
The project is the work of HN user wolfejam, who described the motivation in straightforward terms: cost visibility at call time rather than at billing time. No company name, founding date, or prior funding is mentioned in the source material.
The tool fits into a growing category of LLM cost-management utilities that operate at the SDK or middleware layer, intercepting requests before they reach a provider's API. Pre-flight token counting is a common pain point for developers building on pay-per-token APIs such as those from OpenAI, Anthropic, and Google, where prompt size directly determines cost and a misconfigured or runaway prompt can generate unexpected charges. Slash-tokens approaches this by running the estimation entirely in-process via WASM, meaning no network round-trip is needed to get a cost estimate.
No pricing tiers, enterprise features, or future roadmap details are mentioned in the source. The repository's availability on npm and the bunx invocation pattern suggest a developer-tooling audience rather than an end-user product. The zero-comment, one-point HN post at time of indexing indicates the launch is very early in its public life.
No comments yet — start the thread.