Open Source · Apache 2.0

Know what your
agents cost.

Meter. Budget. Control.

Open-source reverse proxy that gives you real-time cost attribution, budget enforcement, and financial observability for AI agents — without changing a single line of code.

terminal
$ brew install wdz-dev/tap/agentledger
✓ Installed agentledger v1.0.0
$ agentledger serve
▸ Proxy listening on :8787
▸ Dashboard at http://localhost:8787/ui
$ agentledger costs --last 24h --by agent
AGENT            COST
code-reviewer    $1.23
pr-summarizer    $0.08
data-pipeline    $8.41
15 LLM Providers
83+ Models Priced
<10ms Proxy Overhead
Zero Dependencies
Zero Code Changes
100% Free & Open Source

How it works

One env var. Full observability. Zero code changes.

Your AI Agents
Coding assistants, support bots, data pipelines
OPENAI_BASE_URL=:8787
AgentLedger Proxy Go binary · :8787
Budget Enforce
Rate Limiter
Loop Detector
Cost Calculator
Session Tracker
Tenant Resolver
Alert Notifier
Pre-flight Est.
SQLite / Postgres
· Cost ledger
· Dashboard + CLI
· Prometheus /metrics
· Slack / Webhooks
LLM Providers
· OpenAI, Anthropic
· Gemini, Groq, Mistral
· DeepSeek, Azure
· + 8 more
Dashboard

See everything. In real time.

Built-in web dashboard — no Grafana, no Datadog, no extra tools needed.

localhost:8787/ui
Tenant:
all tenants
Apply
Admin Token:
token
Save
Today's Spend
$0.050
Month's Spend
$58.32
Today's Requests
8
Avg Cost / Request
$0.012
Active Sessions
0
Error Rate (24h)
4.7%
Cost Over Time
Last 7 days v
$6.00 $4.00 $2.00 $0.00 Mon Tue Wed Thu Fri Sat Sun
Spend by Provider
Anthropic $75.89
OpenAI $23.59
Mistral $5.58
Gemini $5.15
Groq $1.04
DeepSeek $0.554
Cost Breakdown
By Model v
Name Requests Cost (USD)
claude-sonnet-4.6 256 $8.62
claude-opus-4.6 131 $7.74
gpt-4.1 229 $4.12
gpt-4o 158 $3.28
gemini-2.5-pro 75 $1.22
claude-haiku-4.5 146 $1.20
mistral-large-latest 66 $1.13
o3-mini 80 $0.749
Most Expensive Requests
Agent Model Cost
research-agent claude-opus-4.6 $0.382
code-generator claude-opus-4.6 $0.375
code-generator claude-opus-4.6 $0.369
code-generator claude-opus-4.6 $0.329
code-generator claude-opus-4.6 $0.329
Error Breakdown (24h)
Total Requests
85
Errors
4
Rate Limited (429)
2
Server Errors (5xx)
2
Avg Latency
1580ms
Avg Cost / Request
$0.012
Features

Everything you need to control AI costs

From real-time tracking to budget enforcement — all included, all free.

Zero Code Changes

Set one env var and you're done. Works with any OpenAI or Anthropic SDK.

Real-Time Cost Tracking

Every request metered, every token counted, every dollar attributed. 83+ models with up-to-date pricing.

Budget Enforcement

Daily and monthly limits per API key, per agent, or per tenant. Soft warnings, hard blocks.

Pre-Flight Estimation

Calculates worst-case cost before forwarding to the API. Rejects requests that would exceed your budget.

Agent Session Tracking

Group multi-call agent runs into sessions. See exactly what each execution costs.

Loop Detection

Automatically detects and stops runaway agents stuck in infinite loops. Zero configuration needed.

Ghost Agent Detection

Finds agents that are still running but haven't made a request in a while. Prevents silent cost bleed.

15 LLM Providers

OpenAI, Anthropic, Azure, Gemini, Groq, Mistral, DeepSeek, and 8 more — all behind one endpoint.

Embedded Dashboard

Real-time web UI for cost visibility. No external tools needed.

Prometheus + Grafana

OpenTelemetry metrics, /metrics endpoint, pre-built Grafana dashboard template.

Multi-Tenancy

Isolate costs by team or org. Tenant-scoped budgets and dashboard filtering.

Alerting

Slack and webhook notifications for budget warnings, loop detection, and anomalies.

Rate Limiting

Per-key request throttling with sliding window counters.

Admin API

Runtime budget rule management without restarts. API key blocklist with glob patterns.

MCP Tool Metering

Track costs of MCP (Model Context Protocol) tool calls alongside LLM usage.

CSV/JSON Export

Export cost data for accounting, compliance, or external analysis.

Circuit Breaker

Automatic upstream failure protection. Don't burn money on failed requests.

Providers

15 Providers. 83+ Models. One Proxy.

Route to any provider through a single endpoint. Built-in pricing for every model.

O
OpenAI
A
Anthropic
Az
Azure OpenAI
G
Google Gemini
C
Cohere
Gq
Groq
M
Mistral
D
DeepSeek
T
Together AI
F
Fireworks AI
P
Perplexity
OR
OpenRouter
X
xAI (Grok)
Cb
Cerebras
S
SambaNova
Quick Start

Up and Running in 60 Seconds

No databases. No configuration files. No code changes. Just install and go.

01

Install

One command. No dependencies.

bash
# Homebrew
$ brew install wdz-dev/tap/agentledger

# Or download the binary
$ curl -sSL https://github.com/WDZ-Dev/agent-ledger/releases/latest/download/agentledger_$(uname -s)_$(uname -m).tar.gz | tar xz

# Or Docker
$ docker run --rm -p 8787:8787 ghcr.io/wdz-dev/agent-ledger:latest
02

Start the proxy

Single binary. Zero config needed.

bash
$ agentledger serve
▸ Proxy listening on :8787
▸ Dashboard at http://localhost:8787/ui
▸ Metrics at http://localhost:8787/metrics
03

Point your agents

One env var. Zero code changes.

bash
# OpenAI SDK
export OPENAI_BASE_URL=http://localhost:8787/v1

# Anthropic SDK
export ANTHROPIC_BASE_URL=http://localhost:8787/anthropic

# Any other provider
export GROQ_BASE_URL=http://localhost:8787/groq/openai
04

See what you're spending

Per-agent cost breakdown. Real-time.

bash
$ agentledger costs --last 24h --by agent

AGENT            REQUESTS  INPUT TOKENS  OUTPUT TOKENS  COST (USD)
code-reviewer    47        125,340       42,100         $1.23
pr-summarizer    12        8,200         3,400          $0.08
data-pipeline    156       890,000       245,000        $8.41
TOTAL            215       1,023,540     290,500        $9.72
05

Set budgets

Guardrails before it gets expensive.

yaml
# agentledger.yaml
budget:
  default:
    daily_limit_usd: 50.00
    monthly_limit_usd: 500.00
    soft_limit_pct: 0.8        # warn at 80%
    action: block              # block when exceeded
  rules:
    - api_key_pattern: "sk-proj-dev-*"
      daily_limit_usd: 5.00
    - tenant_id: "team-ml"
      daily_limit_usd: 200.00
Pricing

No pricing page needed.

Everything is free. Forever. No enterprise paywall.

Free.
Forever.

All features included. No usage limits.
Apache 2.0 open source.

Budget Enforcement
Audit Logs
SSO
Multi-Tenancy
Alerting & Webhooks
Admin API
Rate Limiting
Loop Detection
Get Started

AgentLedger vs the Competition

Feature AgentLedger Competitors
Architecture
Go single binary, sub-10ms overhead
Python, documented memory leaks
Cost model
Per-agent-execution tracking
Per-key/user/team only
Loop detection
Built-in, zero-config
Not available
Ghost agent detection
Built-in
Not available
Pre-flight estimation
Rejects before API call
Post-hoc only
Budget enforcement
Free, included
$$$ Enterprise $$$
Audit logs
Free, included
$$$ Enterprise $$$
SSO
Free, included
$$$ Enterprise $$$
Setup
brew install + one env var
Python + pip + database server
Dependencies
Zero (embedded SQLite)
PostgreSQL required, Redis recommended

"Why not just check the OpenAI dashboard?"

The OpenAI dashboard shows total org spend. It doesn't tell you:

  • Which agent execution caused the $47 spike at 3am
  • That your coding assistant is stuck in a loop burning $12/minute
  • That the intern's test script has been running for 6 hours
  • How much each team is spending vs their budget

AgentLedger answers all of these. In real-time. For every provider.

"Why not an existing proxy?"

Existing LLM proxies are mature. They're also:

  • Slow — Python + async overhead, documented memory leaks
  • Heavy — require PostgreSQL, Redis recommended
  • Paywalled — budgets, audit logs, SSO locked behind Enterprise ($$$)
  • Not agent-aware — track per key, not per agent execution

AgentLedger is a single Go binary. Install it. Set one env var. Done.

Built for engineers who hate surprise cloud bills.

AgentLedger is free, open-source, and ships as a single binary with zero dependencies. Star us on GitHub and take control of your AI costs.

We built what we needed. You probably need it too.