The SuperCompress API dashboard lets you sign up, create and revoke API keys, and monitor per-key usage — tokens in, tokens out, and tokens saved — across every compression call your application makes. In local dev mode you can run the full dashboard without any cloud configuration; in production it backs onto Firebase Auth and Firestore.Documentation 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.
Quick start (local dev)
Run the dashboard locally in under a minute using an in-memory key store with no Firebase account required:dev:uid:email tokens — no Firebase project or credentials needed.
Production setup
Create a Firebase project
- Go to the Firebase console and create a new project.
- Enable Authentication and turn on the Email/Password and Google sign-in providers.
- Create a Firestore database in the same project.
- Generate a service account JSON key from Project Settings → Service accounts and save it somewhere safe.
- Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to the path of that JSON file.
Configure the web app
Copy the Firebase web app config into the dashboard’s JavaScript bundle:Edit
firebase-config.js to fill in your project’s apiKey, authDomain, projectId, and SC_API_BASE (the origin of your deployed API server if different from the static file host).Deploy Firestore security rules
Key management
Once signed in, the/dashboard page exposes four operations on every key:
| Action | Description |
|---|---|
| Create | Name your key; the full secret (sc_live_…) is shown exactly once and cannot be recovered afterwards |
| Rename | Update the display name of an existing key at any time |
| Revoke | Permanently disable a key; it is removed from the lookup index immediately |
| Usage | View per-key request count, tokens in, tokens out, and tokens saved |
Environment variables
| Variable | Default | Description |
|---|---|---|
SC_AUTH_DEV | off | Accept dev:uid:email tokens; bypasses Firebase entirely |
SC_KEY_STORE | auto | memory, firestore, or auto (picks Firestore if credentials are present) |
SC_KEY_STORE_FILE | — | Path to a JSON file for lightweight persistence in dev without Firestore |
GOOGLE_APPLICATION_CREDENTIALS | — | Path to the Firebase service account JSON for Firestore and Auth |
API endpoints reference
The FastAPI router exposes two groups of endpoints: dashboard management routes that require a Firebase ID token, and a compression route that requires an API key.Dashboard management (Firebase ID token)
PassAuthorization: Bearer <firebase_id_token> on every request.
| Method | Path | Description |
|---|---|---|
GET | /api/me | Return the current authenticated user’s UID and email |
GET | /api/keys | List all keys and per-key usage summary |
POST | /api/keys | Create a key — body: { "name": "Production" } |
PATCH | /api/keys/{key_id} | Rename a key — body: { "name": "New name" } |
DELETE | /api/keys/{key_id} | Revoke a key permanently |
GET | /api/keys/{key_id}/usage | Usage snapshot for a single key |
Authenticated compression (API key)
Authorization: Bearer sc_live_… if your HTTP client prefers that header. The response includes compressed_text, original_tokens, kept_tokens, kv_savings_pct, and policy_name. Usage is recorded automatically against the key.
Playground (no key required)
POST /api/compress remains unauthenticated for the browser demo and local testing. It accepts the same request body and returns the same response shape.
Security
- Firestore is accessed exclusively from the FastAPI server; the browser client never touches Firestore directly.
- Revoked keys are removed from the hash lookup index immediately — there is no grace period.
- In dev mode (
SC_AUTH_DEV=1) any token in thedev:uid:emailformat is accepted; never run this in production.