Tokensaver, see which parts of your LLM prompt cost money A new open-source tool called tokensaver reports that it cut a sample customer-support system prompt from 834 to 665 tokens on gpt-4o, a 20.3% reduction worth $0.4225 per 1,000 calls and $422.50 per 1 million calls. tokensaver runs fully offline, counts tokens and compares costs across major AI models, and attaches a reason, token savings and dollar value to each suggestion; its default safe rules alone drop the same prompt from 834 to 772 tokens, with review suggestions worth 107 more tokens. The tool's token counting, cost comparison, JSON minification, whitespace cleanup and duplicate detection are tested in CI on 55 languages, though its filler-phrase rule currently covers only English. Find out what your prompt costs on every major AI model, and exactly which changes make it cheaper. Most token counters stop at a number. tokensaver tells you what to change : every suggestion comes with a reason, the tokens it saves, and what that is worth in dollars. It runs 100% offline. Your prompt never leaves your machine. tokensaver works with prompts in any language and any script. Token counting, cost comparison, JSON minification, whitespace cleanup and duplicate detection are tested in CI on 55 languages on every commit see the test https://github.com/behrouzbk/tokensaver/blob/main/tests/test languages.py : Arabic · Bengali · Bulgarian · Burmese Myanmar · Chinese Simplified · Chinese Traditional, Hong Kong · Chinese Traditional, Macau · Chinese Traditional, Taiwan · Croatian · Czech · Danish · Dutch · English · Estonian · Finnish · French · German · Greek · Hebrew · Hindi · Hungarian · Indonesian · Italian · Japanese · Kannada · Khmer · Korean · Lithuanian · Malay · Malayalam · Marathi · Nepali · Nigerian Pidgin · Norwegian · Persian Farsi · Polish · Portuguese Brazil · Portuguese Portugal · Punjabi Gurmukhi · Romanian · Russian · Serbian Cyrillic · Slovak · Slovenian · Spanish · Swahili · Swedish · Tagalog Filipino · Tamil · Telugu · Thai · Turkish · Ukrainian · Urdu · Vietnamese Right-to-left scripts Arabic, Hebrew, Persian, Urdu and languages without spaces between words Chinese, Japanese, Thai, Khmer, Burmese included. The filler rule still speaks only English. Native speakers: add your language's filler phrases in 5 https://github.com/behrouzbk/tokensaver/issues/5 . examples/messy prompt.txt is a typical customer-support system prompt: polite filler, a rule written twice, a paragraph pasted twice, and pretty-printed JSON. bash $ tokensaver optimize examples/messy prompt.txt --apply all Suggestion Tokens $/1k calls Status 1 Minify JSON block 140 chars, was 185 line 13 -18 $0.0450 applied 2 Minify JSON block 200 chars, was 392 line 39 -43 $0.1075 applied 3 Duplicate line: “- Never share internal information…” line 30 -12 $0.0300 applied 4 Duplicate paragraph: “Please note that you must only…” line 34 -41 $0.1025 applied 5 Repeated instruction: “Make sure you keep the answer…” line 32 -12 $0.0300 applied 7 Filler: “I would like you to…” ×1 line 4 -6 $0.0150 applied ... 15 Long example ~198 tokens line 60 ≤198 $0.4950 flag ╭──────────────────────── Total savings on gpt-4o ─────────────────────────╮ │ Before: 834 tokens │ │ After: 665 tokens │ │ Saved: 169 tokens 20.3% = $0.000423 per call, $0.4225 per 1,000 calls, │ │ $422.50 per 1M calls │ ╰──────────────────────────────────────────────────────────────────────────╯ What changed in the prompt: -I would like you to please read the customer's message carefully and answer their question. -As an AI language model, you should always be polite, friendly and professional. +Read the customer's message carefully and answer their question. +You should always be polite, friendly and professional. ... -{ - "answer": "string", - "category": "billing | technical | account | other", - ... -} +{"answer":"string","category":"billing | technical | account | other","confidence":0.0,...} ... -- Never share internal information, discount codes or employee names. -- Make sure you keep the answer under 120 words. With only the default safe rules no wording changes at all , the same prompt drops from 834 to 772 tokens. tokensaver then tells you that the review suggestions would save 107 more, so you decide. pip install prompt-tokensaver The command is tokensaver . Requires Python 3.10 or newer. Works on Windows, macOS and Linux. 1. How many tokens, and what does one call cost? tokensaver count prompt.txt --model gpt-4o tokensaver count "Summarize this article in three bullet points." 2. Which model is cheapest for this prompt? tokensaver compare prompt.txt tokensaver compare prompt.txt --models gpt-4o,claude-sonnet-5-5,gemini-2.5-flash 3. What should I change? safe changes are applied, others are suggested tokensaver optimize prompt.txt 4. Apply everything you agree with and save a copy the original is never overwritten tokensaver optimize prompt.txt --apply all --output prompt.optimized.txt tokensaver optimize prompt.txt --apply json,whitespace,filler -o prompt.optimized.txt Pipe text in with "-", list models and prices cat prompt.txt | tokensaver count - PowerShell: Get-Content prompt.txt | tokensaver count - tokensaver models Windows paths work as usual: tokensaver optimize examples\messy prompt.txt . Run tokensaver