# Introduction

Compress LLM prompts to cut costs and improve accuracy.

## What is The Token Company?

The Token Company builds compression models that remove low-signal tokens from LLM prompts before they reach the model. One API call compresses your input — you pass the compressed text to any LLM.

By stripping noise, the LLM spends its attention on the tokens that actually matter — which is why compressed prompts often score higher than uncompressed ones.

## Why compress?

- **Context management** - fit more documents, history, and tool results into your context window
- **Faster inference** - fewer tokens means lower time-to-first-token and faster responses
- **Improve long context accuracy** - removing low-signal tokens helps the model focus on what matters
- **Cut costs** - save 10-50% on LLM API bills, freeing up budget for more usage

## Installation

```bash
pip install the-token-company
```

## Quick example

```python
from thetokencompany import TheTokenCompany

client = TheTokenCompany(api_key="ttc-...")
result = client.compress("Your long prompt text...")

print(result.output)         # compressed text
print(result.tokens_saved)   # tokens removed
print(result.compression_ratio)  # e.g. 3.2x
```

## How it works

1. Send your prompt to the TTC compression API
2. Receive compressed text back
3. Pass the compressed text to any LLM (OpenAI, Claude, Gemini, etc.)

The SDK wraps this into a single function call. For OpenAI and Anthropic, we provide `with_compression()` (Python) and `withCompression()` (TypeScript) wrappers that handle compression automatically.