~/distillery setup → openclaw
OpenClaw passes ANTHROPIC_BASE_URL through to its internal Claude client — one env var covers all requests.
Overview
OpenClaw is a messaging-channel AI assistant (WhatsApp, Telegram, Discord, and similar) powered by Claude. It uses the `@anthropic-ai/sdk` client and supports a per-provider `baseUrl` override in `~/.openclaw/openclaw.json`. Setting this value routes OpenClaw's Claude traffic through The Distillery.
Why agents save more
OpenClaw processes each incoming WhatsApp, Telegram, or Discord message as a multi-turn conversation loop. Each reply re-sends the full channel history as context; a 20-message thread re-sends 20 messages on every reply.
At 38% distillation, The Distillery reduces that context on every relay cycle. The savings compound across the day's message volume: high-traffic channels benefit more than low-traffic ones.
Prerequisites
You have The Distillery installed and running locally on port 3080. OpenClaw is installed with the `anthropic` provider configured.
$ configure
step 01 / 02Open `~/.openclaw/openclaw.json` and add the `models.providers.anthropic.baseUrl` key. Create the file if it does not already exist.
{
"models": {
"providers": {
"anthropic": {
"baseUrl": "http://localhost:3080"
}
}
}
}~/.openclaw/openclaw.json%USERPROFILE%\.openclaw\openclaw.jsonSession Tracking
Bearer token behavior: The Distillery reads the `Authorization: Bearer <token>` header and stores a SHA-256 hash of it for attribution. The raw token never leaves the request scope; it is never logged or stored.
Idle session flushing: sessions auto-flush after 30 seconds of inactivity. If OpenClaw reconnects after a 30-second gap, a new session starts automatically. This is the expected behavior for agent reconnect loops.
Explicit session boundaries: send the `x-distillery-session-id` header with any UUID v4 string to force a new session regardless of the idle timer. Change the value to start a fresh session; keep it constant to group requests together.
$ verify
step 02 / 02thedistillery statsEvaluating other Claude Code cost-reduction approaches alongside OpenClaw? See how The Distillery compares to Claude Code Router (model-routing approach), Compresr (YC W26), or browse alternatives to Claude Code Router for the full landscape.
Pricing breakdown: thedistillery.com/pricing.