SuperCompress
Benchmarks Agents Blog Changelog Docs Get API key Log in Playground GitHub

Gemini cost reduction guide

Reduce Gemini API costs before inference

Gemini bills you for every input token, so the simplest saving is to stop sending the ones the model does not need for the question. SuperCompress is generally extractive and query-aware: it selects lines from your context that match the question and drops the rest before the Gemini call. Preprocessing may rewrite JSON or collapse stack frames before that selection.

By Arjun Shah - Creator of SuperCompress - Updated 2026-11-11

Where your Gemini costs come from

Most Gemini input spend in agents and apps comes from long logs and test output, tool and MCP results, file reads, retrieved chunks that do not match the question, and long chat history. SuperCompress is generally extractive and query-aware: it selects lines that match this question and drops the rest. Measure original_tokens / kept_tokens (or tokens_saved) on your own traffic.

Other ways to cut the bill

How to measure the cut

The hosted API returns original_tokens, kept_tokens, and tokens_saved as estimates of the compressed context, not provider-billed token counts. MCP compress_context reports compressed_tokens instead of kept_tokens. On MCP passthrough, hosted responses still return original_tokens but leave out compressed_tokens and tokens_saved; the local proxy leaves out all three. Check provider usage for billed totals. Hosted API + MCP, wired into Claude Code, Cursor, Codex and other agents via npm install -g supercompress-proxy && supercompress setup. Using Gemini CLI? See how to reduce Gemini CLI token usage.

Related cost pages

Frequently asked questions

Will compression work with Gemini streaming?

Yes. Compress first, then stream the response.

Does SuperCompress work with Gemini long context?

Yes. Long context is expensive and noisy, so keep the lines that answer the question and drop the rest before the Gemini call.

Do I need to change my Gemini model?

No. Compression runs before the call, so it works with any Gemini model.