General

ClawCost is a local-first, open-source LLM cost tracking proxy. It sits between your application and any LLM provider — Anthropic, OpenAI, Gemini, DeepSeek, or any OpenAI-compatible API — tracking every token in real time, enforcing hard budget limits, and showing a live cost dashboard. All usage data stays in a local SQLite file on your machine. Free to self-host; Pro ($19/mo) adds per-model budgets and spend forecasting.

Developers and teams that call LLM APIs (OpenAI, Anthropic, Gemini, etc.) and want to know exactly what they're spending — and stop spending when they hit a limit. Particularly useful for local AI tooling setups like OpenClaw, LangChain agents, and automated pipelines that can run unexpectedly long overnight.

Yes. ClawCost is MIT-licensed and the full source is on GitHub. The core proxy — token tracking, budget enforcement, local dashboard, and multi-provider support — is free forever. ClawCost Pro ($19/mo) adds per-model budget caps, 90-day history, spend forecasting, and webhook alerts.

Setup

Install globally: npm install -g @modologystudios/clawcost, then run clawcost. Your dashboard opens at http://localhost:4100. Then point your app's LLM base URL to http://localhost:4100/v1 — that's it. No code changes required beyond the base URL.

Set ANTHROPIC_BASE_URL=http://localhost:4100/v1 in your environment before running your app. ClawCost detects Anthropic models automatically and routes to the correct upstream. For OpenClaw specifically, add it to ~/.openclaw/.env.

Anthropic, OpenAI, Google Gemini, DeepSeek, and any OpenAI-compatible API (Ollama, Groq, Together AI, Fireworks, etc.). Provider routing is automatic — ClawCost detects the correct upstream from the model name in each request.

Budgets & Tracking

Set CLAWCOST_DAILY_BUDGET and CLAWCOST_MONTHLY_BUDGET (in USD) in your .env file. You can also update limits live in the dashboard without restarting. When spend reaches your limit, ClawCost returns HTTP 429 to block further requests before any additional charges occur on your provider account.

No measurable latency. ClawCost streams the provider's response directly to your app while parsing SSE events in parallel to extract token counts. It never buffers the full response, so you see the same first-token and streaming latency as a direct API call.

No. ClawCost is local-first by design. Your API keys pass through the proxy to the provider but are never logged or persisted. All usage data (token counts, costs, request history) is stored in a local SQLite database at ~/.clawcost/usage.db. Nothing is sent to external servers.

Comparisons

ClawCost is local-first — your usage data never leaves your machine. Helicone routes requests through their cloud infrastructure for logging and analytics. ClawCost also enforces hard budget limits that block requests before charges occur; Helicone doesn't do this. Full comparison →

LiteLLM is a routing and model-abstraction layer — it normalizes APIs across providers and handles load balancing. ClawCost is focused on cost tracking and budget enforcement. They solve different problems and work well together. Full comparison →

LangSmith is full-stack LLM observability — traces, evaluations, datasets, prompt management. It's a powerful platform for teams building complex LLM applications. ClawCost is narrowly focused: cost tracking and hard budget enforcement, local-first, five-minute setup. If you just want to stop surprise bills without adopting a full observability stack, ClawCost is the right tool. Full comparison →

Pro Plan

Pro ($19/mo) adds: per-model budget caps (set independent limits for GPT-4o vs Claude Sonnet, for example), 90-day cost history, spend forecasting (projected month-end cost based on current burn rate), custom alert thresholds, and outbound webhooks to post alerts to Slack, Discord, or any endpoint. After purchasing, enter your email in the Pro panel on the dashboard to activate.

Yes. Cancel anytime — your Pro features stay active until the end of your billing period, then drop back to the free tier. The free tier has no limits on duration or number of requests tracked.

Still have questions?

Open an issue on GitHub or email us at hello@modology.dev

Get started free
From the same team
Want AI that does more than track costs?

ClawHQ is a self-hosted AI team platform — 30+ agents, Discord and Slack wired up, one Docker command to deploy.

Meet ClawHQ →