Stop the Uber problem before it hits you. An open-source API proxy + FinOps dashboard that sits between your engineers and the Anthropic API β tracking spend, enforcing budget caps, and giving finance teams visibility before your AI bill blows up.
In April 2026, Uber exhausted its entire 2026 AI budget in 4 months β driven by Claude Code adoption spreading through 5,000 engineers faster than any budget model could anticipate. Per-engineer costs hit $500β$2,000/month. No guardrails. No visibility. No plan.
This is a solvable problem.
Engineer's Claude Code
β
βΌ
βββββββββββββββββββββββββ
β Claude Cost Guardianβ β Proxy + Middleware
β Proxy (port 3001) β
β β
β 1. Auth engineer β
β 2. Check budget β β Block if over hard limit
β 3. Forward request β β Warn if over soft limit
β 4. Track tokens β β Record usage + cost
β 5. Emit alerts β
βββββββββββββββββββββββββ
β
βΌ
Anthropic API (real)
β
βΌ
βββββββββββββββββββββββββ
β Dashboard (port 5173β
β React + Recharts β
β β
β β’ Per-engineer spend β
β β’ Team budgets β
β β’ Daily trend chart β
β β’ Blocked engineers β
βββββββββββββββββββββββββ
| Feature | Status |
|---|---|
| π API proxy (drop-in for Anthropic API) | β |
| π Per-engineer spend tracking | β |
| π¦ Soft limit warnings (pass-through with header) | β |
| π Hard limit enforcement (block with 429) | β |
| π₯ Team-level budget caps | β |
| π Daily spend trend dashboard | β |
| π·οΈ Engineer tiers (standard / power / restricted) | β |
| π Alert system | β |
| ποΈ SQLite storage (zero-dependency) | β |
| π YAML policy config | β |
| π OpenAI Codex / other providers | π§ Coming |
| π§ Slack / email alerts | π§ Coming |
| π SSO / LDAP engineer sync | π§ Coming |
- Node.js 18+
- npm 9+
git clone https://github.com/your-org/claude-cost-guardian
cd claude-cost-guardian
npm installcp .env.example .env
# Edit .env and set your ANTHROPIC_API_KEYEdit config/policy.yaml:
teams:
default:
monthlyCapUSD: 5000
perEngineerSoftLimitUSD: 150 # Warning threshold
perEngineerHardLimitUSD: 500 # Block thresholdnpm run dev- Proxy β
http://localhost:3001 - Dashboard β
http://localhost:5173 - Metrics API β
http://localhost:3001/api/metrics/overview
Add to your ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:3001/proxy",
"ANTHROPIC_API_KEY": "your-key-here"
},
"http": {
"headers": {
"x-engineer-id": "your-engineer-id"
}
}
}Or set environment variables:
export ANTHROPIC_BASE_URL=http://localhost:3001/proxy
export CLAUDE_EXTRA_HEADERS='{"x-engineer-id": "alice@company.com"}'When an engineer hits their soft limit, requests pass through but include warning headers:
X-Budget-Warning: Soft limit of $150.00 exceeded. Current spend: $162.40 / $500.00 hard limit.
X-Budget-Utilization: 32.48
When an engineer hits their hard limit, the proxy returns HTTP 429:
{
"error": "Budget limit reached",
"reason": "Monthly hard limit of $500.00 reached. Spent: $523.10. Resets 2026-06-01.",
"currentSpend": 523.10,
"limit": 500.00,
"resetDate": "2026-06-01T00:00:00.000Z"
}Set per-engineer tiers to multiply their team limits:
| Tier | Multiplier | Use case |
|---|---|---|
standard |
1x | Most engineers |
power |
3x | Staff engineers, ML leads |
restricted |
0.25x | Probation, cost control |
Guardian uses the latest Anthropic pricing (per million tokens):
| Model | Input | Output | Cache Read | Cache Write |
|---|---|---|---|---|
| claude-opus-4-5 | $15 | $75 | $1.50 | $18.75 |
| claude-sonnet-4-5 | $3 | $15 | $0.30 | $3.75 |
| claude-haiku-4-5 | $0.8 | $4 | $0.08 | $1.00 |
Full org overview: total spend, top spenders, trend data.
Per-engineer spend summaries for the current month.
Team-level budget summaries.
Daily spend trend (default last 30 days).
Active (unresolved) alerts.
claude-cost-guardian/
βββ packages/
β βββ proxy/ # Express proxy server
β β βββ src/
β β βββ index.ts # Main proxy + API server
β β βββ db.ts # SQLite storage layer
β β βββ policyEngine.ts # Budget enforcement logic
β β βββ logger.ts # Winston logger
β β βββ routes/
β β βββ metrics.ts # Dashboard API endpoints
β β βββ alerts.ts
β βββ dashboard/ # React dashboard
β β βββ src/
β β βββ App.tsx # Main dashboard UI
β βββ shared/ # Shared TypeScript types
β βββ src/
β βββ index.ts # Types, pricing constants
βββ config/
β βββ policy.yaml # Budget policy config
βββ .env.example
docker build -t claude-cost-guardian .
docker run -e ANTHROPIC_API_KEY=sk-ant-... -p 3001:3001 claude-cost-guardianRun the proxy on an internal server. Point all engineers' ANTHROPIC_BASE_URL to it. The SQLite DB persists on the server's filesystem.
PRs welcome. Especially for:
- Slack / email alert integrations
- OpenAI Codex / Gemini proxy support
- LDAP / Okta engineer sync
- Per-repo or per-project budget attribution
MIT