Engineering · 10 min read
How compression + routing cut spend 60–90%
"60–90% cheaper" sounds like marketing until you do the arithmetic. Two techniques do most of the work, and they multiply rather than add. Here's the real per-token math.
Lever one: token compression
Most prompts an agent sends are mostly repetition — the same system prompt, the same tool schemas, stale conversation turns, and tool output that's far larger than the model needs. The compression engine rewrites that into a denser stream using four passes:
- Prompt-cache reuse — repeated context is billed once, at the discounted cache rate.
- Context compaction — dead turns and spent tool output are folded out losslessly.
- Semantic dedup — near-identical spans collapse above a 0.97 similarity floor.
- Structural rewrite — whitespace, JSON and markup are normalised to a dense form.
Conservatively, that removes about half of prompt tokens. On a 12,000-token prompt, you're now sending ~6,000 — before a single routing decision.
Lever two: complexity-based routing
Not every request needs a flagship. A lightweight classifier scores each one and routes simple work to an economy model. Take real per-1M-token rates:
- Flagship:
$3.00in /$15.00out - Economy:
$0.20in /$0.60out
On output tokens alone, the economy model is 25× cheaper. Even if only 70% of your requests are "simple," the blended rate collapses.
Putting it together
Consider 200,000 requests/month, 12,000 input and 1,500 output tokens each, all on the flagship:
- Baseline: 200k × (12k×$3 + 1.5k×$15) / 1M ≈ $11,700/mo.
- With Cohesor: halve input tokens, route 70% to economy, add the flat $10/100K gateway fee — and the same workload lands well under $3,000/mo.
That's the 60–90% range, and it's why the gateway fee is a rounding error against what it saves. The two levers compound: compression shrinks every request, routing re-prices the ones that don't need the big model.
Compression makes each request smaller. Routing makes each request cheaper. Multiply, don't add.
The best part: neither changes your code. Point your agent at api.cohesor.com and both are on by default.