# OpenRouter

Automatic compression for OpenRouter API calls. Uses the OpenAI-compatible wrapper.

## Setup

```python
from openai import OpenAI
from thetokencompany.openai import with_compression

client = with_compression(
    OpenAI(base_url="https://openrouter.ai/api/v1", api_key="YOUR_KEY"),
    compression_api_key="ttc-...",
)

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Your text..."}],
)
```

Works with any OpenAI-compatible provider — Together AI, Groq, Fireworks, etc.