Skip to content
The Distillery
Docs / Clients / OpenClaw
SETUP · openclawverified

~/distillery setup → openclaw

OpenClaw passes ANTHROPIC_BASE_URL through to its internal Claude client — one env var covers all requests.

vendorAnthropic
authAPI key
methodconfig file
portlocalhost:3080
compoundingagent · highest ROI

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.

Two separate credentials: your Anthropic API key (sent to Anthropic for billing) and your Distillery login token (stays local, used for cost tracking only). Mixing these up is the most common setup mistake.

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.

Messaging-channel agents are high-ROI: each relay turn re-sends conversation history. Distillation applies on every turn.

Prerequisites

You have The Distillery installed and running locally on port 3080. OpenClaw is installed with the `anthropic` provider configured.

$ configure

step 01 / 02

Open `~/.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"
      }
    }
  }
}
macOS · Linux
~/.openclaw/openclaw.json
Windows
%USERPROFILE%\.openclaw\openclaw.json

Session 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 / 02
01Trigger any OpenClaw Claude request (send a message on a connected channel). In a terminal, run:
thedistillery stats
$ comparing tools

Evaluating 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.