Get API key

Usage

Two ways to compress prompts with SuperCompress: call the hosted API (zero setup) or install the local library (runs on CPU, no GPU needed).

Options

  1. Hosted API (recommended)
  2. Local Python library
  3. Which to choose?

Hosted API (recommended)

The fastest way to use SuperCompress in production. Get an API key, call the endpoint, done. No servers, no containers, no config.

Get a key

Sign in at supercompress.dev/dashboard with Google or email and create an API key. Free allowance includes 5M tokens/month ($5 worth).

Call the API

# Quick one-liner (form-encoded)
curl -d "context=Your long context...&query=What do you want to know?" \
  https://supercompress.dev/compress \
  -H "X-API-Key: sc_live_YOUR_KEY"

# Or as JSON (standard)
curl -X POST https://supercompress.dev/api/v1/compress \
  -H "X-API-Key: sc_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"context":"Your long context here…","query":"What do you want to know?"}'

# Or GET with query params
curl "https://supercompress.dev/compress?context=...&query=...&api_key=sc_live_YOUR_KEY"

Python client

from supercompress.client import SuperCompress

sc = SuperCompress()  # reads SUPERCOMPRESS_API_KEY
out = sc.compress(context, question)
print(out.compressed_text)

Set your key as an environment variable:

export SUPERCOMPRESS_API_KEY=sc_live_YOUR_KEY
Free tier 5M tokens/month free ($5). After that, pay-as-you-go at $1 / 1M tokens. Usage tracked in your dashboard.

Local Python library

Run SuperCompress entirely on-device. The library bundles the trained policy (a learned query-aware neural policy, ~200KB) — no model downloads, no GPU, no external dependencies.

Install

pip install supercompress

Use it

from supercompress import compress_context

result = compress_context(
    text="Your long context…",
    question="What does fetch return?",
)

print(result.compressed_text)
print(f"Saved {result.kv_savings_pct:.1f}% tokens")

Deploy it on your own server

Since the library is just pip install supercompress, you can run it on any Python 3.10+ environment — your own server, a container, or a serverless function. No special setup required.

# Works anywhere Python runs
pip install supercompress

# Then in your app code
from supercompress import compress_context

Browser / static sites

Compression also runs in-browser. The playground at supercompress.dev/playground runs the same policy client-side — no API key needed.

Which to choose?

Hosted APILocal library
SetupGet a key, call the endpointpip install supercompress
Latency overhead~5ms network + processing~60ms in-process
External depsNone (HTTP client only)Python 3.10+
Rate limitsFree: 5M tok/mo; then PAYG $1/1MUnlimited (your hardware)
Data privacyContext sent to APIStays on your machine
Best forQuick integration, low traffic, prototypingHigh volume, latency-sensitive, air-gapped
Data & privacy With the local library, context never leaves your machine. The hosted API receives the context you send and returns the compressed version — we don't store prompt content.