OpenGauge: Open-source tool for tracking LLM agent costs locally

✍️ OpenClawRadar📅 Published: March 22, 2026🔗 Source
OpenGauge: Open-source tool for tracking LLM agent costs locally
Ad

What OpenGauge does

OpenGauge is an open-source monitoring tool that tracks API usage and costs for LLM agents like those built with OpenClaw. It runs locally on your machine, storing all data in a SQLite database without sending information to external services.

Key features from the source

  • Proxy mode: Routes API calls through OpenGauge for automatic logging. Command: npx opengauge watch ANTHROPIC_BASE_URL=http://localhost:4000 claude
  • Cost statistics: Shows detailed breakdowns with commands like npx opengauge stats --period=7d that display per-model costs, daily trends, token counts, and most expensive sessions
  • Circuit breaker: Detects and stops runaway loops where agents make repeated identical calls
  • Budget limits: Can be set per session, daily, or monthly to prevent unexpected charges
  • Multi-provider support: Works with Anthropic, OpenAI, Gemini, and local models through Ollama
  • OpenClaw plugin: Specific integration for OpenClaw agents with simple installation: openclaw plugins install /openclaw-plugin followed by openclaw gateway restart
Ad

How it addresses common problems

The source author reported issues with:

  • Lack of visibility into per-session costs (only seeing total usage in provider dashboards)
  • Runaway loops where an agent made the same call 30+ times before being stopped
  • Unexpected billing alerts due to uncontrolled usage

OpenGauge solves these by providing session-level cost tracking, similarity detection for repeated prompts, and configurable budget limits.

Getting started

For general use: npx opengauge (no installation needed)

For OpenClaw-specific tracking: npx opengauge stats --source=openclaw or npx opengauge stats --source=openclaw --period=7d

The tool can also function as a proxy for other development tools like Claude Code and Cursor.

📖 Read the full source: r/openclaw

Ad

👀 See Also