AI / 自動化 2026年6月4日

OpenClaw を Headroom プロキシ経由でルーティングし API コストを削減

VpsGona エンジニアリングチーム 2026年6月4日 ~14分
OpenClaw Headroom proxy

Headroom は OpenClaw のツール出力を LLM 前に圧縮(プロキシ 8787、東京ノード可)。onboard · OTEL · launchd

開示:任意の Mac レンタル。

構成

OpenClaw → Headroom http://127.0.0.1:8787 → API
ModeWhenOpenClaw hook
headroom proxy --port 8787Zero code changeSet ANTHROPIC_BASE_URL in ~/.openclaw/.env
ContextEngine pluginNative OpenClaw pathHeadroom providers/openclaw slice
MCP headroom_compressMCP-heavy flowsheadroom mcp install
headroom wrapOne-shot devLess ideal for 24/7 gateway

マトリクス

PatternHookSavings bandOps
Nightly launchd auditProxy + plist env70–92% on tool-heavy turnsKeep proxy alive with LaunchAgent
Interactive gateway chatProxy or plugin40–70%Low gain on tiny prompts
MCP-only micro toolsMCP compress tool30–60%When proxy blocked
Already on Ollama localSkip HeadroomN/ASee Ollama OpenClaw guide
Need token accountingProxy + OTELMeasure, don’t guessheadroom perf + spans

前提

  • ゲートウェイ正常 · Python 3.10+

8ステップ

  1. pip install "headroom-ai[proxy]"
  2. headroom proxy --port 8787
  3. headroom perf
  4. ANTHROPIC_BASE_URL=http://127.0.0.1:8787 · openclaw gateway restart
  5. エージェント smoke
  6. 任意プラグイン
  7. launchd env
  8. OTEL

夜間監査

ログ多めで 60–92% 帯が現実的(README ベンチ)。

MCP

プロキシ + MCP 圧縮、OTEL で重複確認。

トラブル

接続拒否:プロキシ先行。請求不変:base URL 確認。

ツール多いならプロキシ必須。

FAQ

Does Headroom send my code to a third-party API?

No for the default local proxy—compression runs on your host; see limitations.

Will OpenClaw break if compression is too aggressive?

Headroom publishes benchmark accuracy tables; use CCR retrieve when the model needs full files. Smoke-test one real audit before automating.

What port should I standardize on?

8787 is the documented default for headroom proxy --port 8787.

How does this relate to Claude Code MCP Headroom?

Same project: headroom mcp install for MCP clients; OpenClaw users usually set provider base URL to the proxy.

Can I save ~80% on every request?

No—published ranges are 47–92% by workload. Log-heavy OpenClaw audits trend high; short chat trends low. Use headroom perf and OTEL.

プロキシ導入

8787・base URL 変更・perf で計測。