slash-tokens
v1.6.5
Published
Token Optimization for Context Engineers. 4.8 KB WASM. Sub-millisecond. Zero dependencies.
Maintainers
Readme
/slash-tokens
Token Optimization for Context Engineers. For anyone building with LLMs. 4.8 KB WASM. Sub-millisecond. Zero dependencies.
Know the cost before the call leaves your machine.
Models change. Windows grow. Slash adapts — you keep building. Cheaper tokens haven't shrunk the bill — usage has.
v1.6.5 — The Fixed Deal Edition
Solo $20 mailbox, 10% waived. Team $39 for the data.
Free forever is bunx — no account. A one-person account is email → key, $20 on the house. We show the savings. We don't charge. 10% is the model, waived. Team is $39 for the data ($390/year).
bunx slash-tokens
# or: npx --yes slash-tokensRun it in a project that already calls an LLM. An empty folder prints that nothing was found — that's normal.
npm install slash-tokensimport { preflight, preflightRoute } from 'slash-tokens'
// Analysis — cheaper alternatives across all providers. Not a route.
const check = preflight(prompt, 'claude-opus-5')
check.tokens
check.cost
check.fits
check.options
// Routing decision — same-provider only, matches the Slash proxy
const route = preflightRoute(prompt, 'claude-opus-5')
// { model: 'claude-haiku', cost, salvaged, salvagePercent } or nullOr one line — every LLM call checked pre-call:
import 'slash-tokens/auto'Intercepts fetch() to Anthropic, OpenAI, xAI, and Google. Estimates before the call leaves your machine. Same-provider cheaper swap if one fits.
See it work
A live chat with every call through the gate: live demo
Then bunx slash-tokens, get a key ($20 on the house), or Team — $39 for the data.
Dashboard
Track savings across all your apps. One-person key (email, $20 on the house) at mcpaas.live/slash/setup
Full docs, examples, and model pricing at GitHub
License
Code: MIT. Fork it, ship it, change it, show it, share it, sell it.
Brand: reserved. The slash-tokens name, ⚡ mark, and red/gold colors stay with the project. If you're building on top of the SDK, ship under your own name and colors — don't represent your app as Slash. See NOTICE.
🏎️ Don't go to the Corner Shop in a Ferrari. · slashtokens.com
