5 tools
Prompt and Cost Optimisation Tools
Remove what you are paying for and getting nothing back.
Some of the tokens in a prompt carry meaning. Others are indentation, repeated JSON keys, trailing whitespace and boilerplate. You are billed identically for both.
On English prose the recoverable share is two or three percent and not worth your afternoon. On pretty-printed JSON, tabulated data or deeply indented code it is routinely thirty to fifty, and it recurs on every request forever.
- Prompt Token OptimizerStrip the tokens you are paying for and getting nothing back.
- Text Splitter for RAG and EmbeddingsChunk text by real tokens, with overlap, without cutting mid-sentence.
- Prompt Diff and Token ComparisonTwo versions of a prompt, side by side, with the cost of the difference.
- Data Format Token ComparisonThe same data as JSON, CSV, YAML or a markdown table. One is much cheaper.
- Prompt Cache Structure CheckerFind the timestamp at line two that is destroying your cache hit rate.
Which one you need
Measure before you cut. The token profiler shows where the length actually is, and it is routinely not where people assume — repeated examples, boilerplate headers and pretty-printed JSON usually outweigh the prose everyone is looking at.
The cache checker is the highest-value tool in this category and takes thirty seconds. Caching is a configuration flag with a large saving attached, and the reason it silently fails is almost always one dynamic value near the top of the prompt.
Compression tools come after both. Shortening a prompt that was never cached is optimising the wrong variable, because caching would have reduced the same tokens by ninety percent without touching the wording.
Whatever you change, keep a before and after on your evaluation set. Prompt edits routinely fix the case in front of you and break two you were not looking at.
Questions
Does a shorter prompt give worse answers?
Not usually, and often the reverse. Prompts accumulate instructions that fix cases that no longer occur, and the fiftieth instruction dilutes the first. What matters is whether the removed lines were doing anything, which is a measurement rather than a judgement.
What saves the most on an unoptimised prompt?
Prompt caching, on any application with a system prompt over about a thousand tokens. It applies to every request and it is a flag. Model routing saves more in absolute terms but takes a week rather than an hour.
Guides that use these tools
- How to reduce LLM API costs — Nine levers, ordered by what they return per hour of work. Most teams find 40% in the first three.
- Context window vs token limit vs max tokens — Three terms, three different limits, one very common production bug.
- Why your JSON costs three times more tokens than you think — Half a JSON payload can be structure the model gains nothing from. Here is how to find it.
- Chunking strategies for RAG that actually retrieve — Chunk size, overlap and boundaries — and how to tell which one is breaking your retrieval.