DocsQuick Start

Quick Start

Get up and running with Compresr in under 5 minutes.

1. Get Your API Key

  1. Create an account at compresr.ai
  2. Navigate to Dashboard → API Keys
  3. Click “Create New Key” and copy it (shown only once!)

Your key starts with cmp_

2. SDK

Use Compresr directly in your code to compress context before sending to any LLM.

Install

pip install compresr

Compress

from compresr import CompressionClient

client = CompressionClient(api_key="cmp_your_api_key")

result = client.compress(
    context="Your very long context that needs compression...",
)

print("Compressed:", result.data.compressed_context)
print(f"Tokens: {result.data.original_tokens} -> {result.data.compressed_tokens}")

Full SDK docs → — streaming, async, FilterClient, and more

3. Context Gateway

For AI agents like Claude Code, Cursor, or OpenClaw — no code changes required. The gateway sits between your agent and the LLM API and compresses context automatically.

Install

curl -fsSL https://compresr.ai/api/install | sh

Launch (interactive wizard)

context-gateway

Use your agent as usual

The gateway runs in the background. It compresses history, tool outputs, and tool definitions automatically when context hits 75% of the limit. Your agent never knows the difference.

Full Gateway docs → — configuration, supported agents, deployment