Guide · Updated 2026-10-18
How to cut LLM API costs
The most reliable way to cut LLM API costs is to send fewer input tokens per call, because input (history, retrieved documents, tool output) is usually most of what you pay for. Use prompt caching for stable prefixes, trim old history, and compress bulky context before the call. SuperCompress does the last part: a hosted model keeps the original lines that answer the current question and drops the rest, so your OpenAI, Claude or Gemini call gets smaller without paraphrasing anything.
Where the money goes
Providers bill per token in and per token out. In chatbots, RAG apps and coding agents, the input side grows every turn: the whole conversation, every retrieved chunk and every tool result is sent again. The reply is usually small by comparison. So the biggest lever is the size of what you send.
Steps that work, in order
- Measure first. Log input and output tokens per call and per feature so you know which calls are expensive.
- Use prompt caching for long system prompts and other prefixes that do not change. Check your provider's docs for how cached input is billed.
- Trim history. Drop or compact old turns that no longer matter.
- Retrieve less, then compress. Fetch fewer chunks, then compress what is left against the question so only relevant lines reach the model.
- Compress tool output. In agents, large logs, diffs and MCP results are the usual culprit.
Where SuperCompress fits
SuperCompress sits right before your model call. Send the bulky part as context and the user's ask as query; it returns the original lines that matter and reports original_tokens and kept_tokens, so you can see the effect on your own traffic. The query itself is never compressed.
curl -X POST https://www.supercompress.dev/api/v1/compress \
-H "X-API-Key: $SUPERCOMPRESS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"context":"<large context>","query":"<the user question>"}'
How SuperCompress works
SuperCompress is hosted, query-aware context compression. Your agent or app sends a bulky block of context (a log, a diff, a long file read, an MCP result, retrieved documents) together with the question being asked. The hosted Neural Keep model, a model of roughly 400M parameters, scores each line against that question, keeps the original lines that answer it word for word, and drops the rest. Nothing is paraphrased, so error messages, file paths, IDs and code come through exactly as they were.
Coding agents reach it through an MCP tool (compress_context) plus hooks that the setup command installs where the agent supports them. Apps reach it through POST /api/v1/compress, which returns the kept text along with original_tokens and kept_tokens so you can see what changed on your own traffic. See the benchmarks page for the published methodology.
Compression vs other cost tools
| Approach | What it does | Combine with compression? |
|---|---|---|
| Prompt caching | Cheaper reuse of identical prefixes | Yes, compress the changing part, cache the stable part |
| Summarization | Rewrites context in fewer words, can lose exact details | Use SuperCompress where details must stay verbatim |
| Truncation | Keeps the first or last part, may drop the evidence | Compression picks lines by relevance instead of position |
| Shorter replies (for example Caveman) | Cuts output tokens | Yes, it acts on the other side |
How to pick fairly
Every tool in this space publishes its own headline numbers, and independent studies have found that fewer tokens do not always mean a smaller bill once prompt caching, retries and extra agent turns are counted. (see PointFive's end-to-end study, the code-compression-bench SWE-bench runs, JetBrains' rtk trial and the THOL leaderboard; none of them tested SuperCompress) Run the same tasks with and without a tool, check that the tasks still succeed, and compare your provider bill per finished task. That test matters more than any vendor page, including this one.
Provider-specific guides: reduce OpenAI costs, reduce Claude costs, reduce Gemini costs, reduce Claude Code token usage, reduce Cursor token usage.
Try it
One command installs the CLI and wires the hosted compressor into every coding agent it finds on your machine (Claude Code, Cursor, Codex, Windsurf, Cline, Gemini CLI, OpenCode and more). Then supercompress doctor shows a health check per agent.
npm install -g supercompress-proxy && supercompress setup
Building your own app instead? Call the hosted API with a key from the dashboard.
FAQ
What is the best way to cut LLM API costs?
Send fewer input tokens. Cache stable prefixes, trim old history, retrieve fewer chunks, and compress bulky context against the current question with a tool such as SuperCompress.
Does compressing prompts reduce OpenAI and Claude bills?
Fewer billed input tokens lower metered spend, but check total cost per successful task, since caching, retries and extra turns also matter.
Will compression hurt answer quality?
SuperCompress is extractive: it keeps original lines verbatim rather than rewriting them. Still, test on your own tasks and keep files the model must edit whole.
Does SuperCompress work with any model provider?
Yes. Its output is plain text, so you can send it to OpenAI, Anthropic, Google or any other model.