Headroom API compresses your messages before they hit OpenAI or Anthropic. Same results. Fraction of the cost. One API call.
No credit card required ยท Free tier available ยท 2-minute setup
60โ95%
Average token reduction
<50ms
Compression latency
7x
Average ROI on Builder plan
Every AI agent, RAG pipeline, and chat feature you ship sends thousands of tokens to OpenAI or Anthropic โ including old conversation history, tool outputs, and context you don't even need.
The open-source Headroom library compresses that context by 60โ95% with no accuracy loss. But it requires Python, self-hosting, and maintenance.
We host it for you. One API call. Done.
WITHOUT HEADROOM API
WITH HEADROOM API
Takes under 5 minutes. No infrastructure changes required.
Compress your messages first, then send to any LLM provider.
# Before sending to OpenAI
response = requests.post(
"https://headroom-api.vercel.app/v1/compress",
headers={"X-API-Key": "hr_..."},
json={"messages": messages}
)
compressed = response.json()
# tokens saved: {compressed["tokens_saved"]}
Change one URL. Zero other code changes. Works with any OpenAI SDK.
# Before
client = OpenAI(
base_url="https://api.openai.com/v1"
)
# After โ that's it
client = OpenAI(
base_url="https://headroom-api.vercel.app/v1/proxy/openai",
api_key="hr_your_key",
default_headers={"X-OpenAI-Key": "sk-..."}
)
The maths works at every tier. If Headroom saves you more than the plan costs, it's a no-brainer.
$29/mo
Best for: indie projects, small apps
$99/mo
Best for: production apps, agencies
$299/mo
Best for: high-volume AI products
๐ก Spending $1,000/mo on OpenAI? With 70% compression you save $700/mo. The Builder plan pays for itself 7x over.
Headroom uses semantic compression โ it removes redundant tokens while preserving meaning. In benchmarks, compressed contexts produce responses indistinguishable from full-context responses.
Any provider that accepts the OpenAI message format โ OpenAI, Anthropic, Mistral, Groq, Together AI, and more. The proxy mode currently wraps OpenAI directly; compress mode works with any provider.
We count tokens going into the compression endpoint (tokens_in). You're billed on what you compress, not what you save โ the savings are yours to keep.
Yes โ Headroom is fully open-source at github.com/chopratejas/headroom. We're the hosted version for teams who'd rather not manage infrastructure.
Get an API key in seconds. No credit card required. Free tier available.
Read the docs โ