SuperCompress

Guide · Updated 2026-11-12

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 selects the lines that match the current question and drops the rest. Preprocessing may rewrite JSON or collapse stack frames before that selection.

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

  1. Measure first. Log input and output tokens per call and per feature so you know which calls are expensive.
  2. Use prompt caching for long system prompts and other prefixes that do not change (OpenAI, Anthropic). Keep the stable part first and put the part that changes each call, including compressed context, after it, because rewriting the prefix resets cache reuse.
  3. Trim history. Drop or compact old turns that no longer matter.
  4. Retrieve less, then compress. Fetch fewer chunks, then compress what is left against the question so only relevant lines reach the model.
  5. Compress tool output. In agents, large logs, diffs and MCP results are the usual culprit.
  6. Cap output and batch what can wait. Set a sensible output limit, and send work that does not need an immediate answer through your provider's batch API, which is billed at a discount.

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 lines that match the question 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 API selects the lines that match that question and drops the rest. Selection is generally extractive, so what comes back are lines from your own context rather than a summary. Preprocessing may rewrite JSON or collapse stack frames before that selection.

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. Those counts are estimates of the compressed context, not provider-billed totals, so check your provider's usage page for the bill. When a context is already small, the API returns it unchanged with passthrough: true; see when to use prompt compression.

Compression vs other cost tools

ApproachWhat it doesCombine with compression?
Prompt cachingCheaper reuse of identical prefixesYes, compress the changing part, cache the stable part
SummarizationRewrites context in fewer words, can lose exact detailsUse SuperCompress where you need lines from the source context rather than a rewrite
TruncationKeeps the first or last part, may drop the evidenceCompression picks lines by relevance instead of position
Shorter replies (for example Caveman)Cuts output tokensYes, 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. We walk through that check in does context compression lower your bill.

Provider-specific guides: reduce OpenAI costs, reduce ChatGPT and OpenAI API costs, reduce Claude costs, reduce Gemini costs, reduce Claude Code token usage, reduce Codex token usage, reduce Cursor token usage.

Try it

One command installs the CLI, signs you in through the browser and registers the hosted compressor with the supported coding agents it finds on your machine, such as Claude Code, Cursor, Codex, Gemini CLI and OpenCode. 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.

Should I use prompt caching or compression?

Both, for different parts of the prompt. Caching makes an unchanged prefix cheaper to resend; compression sends fewer tokens of the part that changes each call. Keep stable instructions first so they cache, and put the compressed per-question context after them.

Will compression hurt answer quality?

Selection is generally extractive: it keeps lines from your context rather than writing a summary, though preprocessing may rewrite JSON or collapse stack frames first. 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.

Get API key Coding agents guide All alternatives