The local development server is a FastAPI application that replicates the full SuperCompress web surface on your machine — the browser demo, theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/arjunkshah/supercompress/llms.txt
Use this file to discover all available pages before exploring further.
/dashboard for API-key management, the unauthenticated /api/compress playground, and the authenticated /v1/compress endpoint. It is intentionally separate from the public Vercel site, which performs all compression client-side in the browser and never calls a backend.
Prerequisites
Install theserve extra alongside the core library:
fastapi, uvicorn[standard], pydantic, and httpx. If you also want Firebase-backed key storage for a closer-to-production setup, add the firebase extra:
Start the server
Set dev environment variables
SC_AUTH_DEV=1 disables Firebase token verification so any request is treated as authenticated. SC_KEY_STORE=memory keeps API keys in process memory instead of Firestore — no GCP credentials required.Available endpoints
Once the server is running the following URLs and routes are available:| URL / Route | Description |
|---|---|
http://127.0.0.1:8790 | Landing page / browser demo |
http://127.0.0.1:8790/dashboard | API key management dashboard |
POST /api/compress | Unauthenticated playground — no key required |
POST /v1/compress | Authenticated compress endpoint — requires an API key |
GET /api/health | Health check |
GET /api/me | Current user info (requires Firebase token) |
GET /api/keys | List API keys (requires Firebase token) |
With
SC_AUTH_DEV=1 set, the Firebase token checks on /api/me and /api/keys are bypassed, making it easy to test key management flows without a real Firebase project.Verify the server is healthy
Compress text via the playground endpoint
POST /api/compress is unauthenticated and is the same route the browser demo calls. The compare flag adds a full policy comparison (FIFO, Truncation, Summarization, H2O, SuperCompress) to the response alongside per-line annotations:
compressed_text, original_tokens, kept_tokens, kv_savings_pct, kept_line_ratio, policy_name, budget_ratio, line_annotations, and — when compare: true — a compare map keyed by policy name.
Call the authenticated endpoint
POST /v1/compress mirrors the hosted API and requires an X-API-Key header. Create a key via the /dashboard UI, then:
Relationship to the public Vercel site
The public Vercel deployment of
web/ is fully static. Compression is performed client-side by the JavaScript engine in web/assets/js/compress-engine.js — no backend server is involved. The local dev server exists solely to develop and test the API layer, dashboard, and key-management flows.