Real-time token tracking, cost forecasting, and rate limit prediction for the Anthropic Claude API.
Self-hosted Β· Open source Β· Zero code changes Β· Free forever.
Claude's API has no built-in dashboard. You're flying blind on cost, token burn, rate limits, and per-session usage. ClaudeTrack fixes that β it's a transparent proxy + analytics layer that sits between your code and Anthropic, giving you full visibility with zero changes to your application code.
No SaaS subscription. No data leaving your infrastructure. No vendor lock-in.
# 1. Clone
git clone https://github.com/your-org/claudetrack.git
cd claudetrack
# 2. Configure (one env var)
echo "SESSION_SECRET=$(openssl rand -hex 32)" > .env
# 3. Run
docker compose up -d
# β Dashboard at http://localhost:5000That's it. Three commands.
The Anthropic SDK reads ANTHROPIC_BASE_URL from your environment automatically. Add two lines to your .env and your existing code is tracked without modification:
# In your application's .env (not ClaudeTrack's)
ANTHROPIC_API_KEY="cti_your_proxy_key_from_dashboard"
ANTHROPIC_BASE_URL="http://localhost:5000/proxy/v1"
# Run your app exactly as before β every Claude call is now tracked.Works with every platform that uses the Anthropic SDK:
| Platform | How |
|---|---|
| Python | ANTHROPIC_BASE_URL=... python app.py |
| Node / TypeScript | Add to .env or process.env before imports |
| Docker | environment: block in docker-compose.yml |
| Railway / Render / Fly.io | Set env vars in dashboard β no redeploy needed |
| Vercel | Environment Variables settings page |
| LangChain / LlamaIndex | Inherited automatically from anthropic SDK |
If you'd rather keep your Anthropic key on your own server, use SDK-only mode β your app calls Anthropic directly, then posts only token counts to ClaudeTrack. Your key never touches our proxy.
| Feature | Description |
|---|---|
| Real-time request log | Every Claude call logged with model, tokens, cost, latency |
| Cost forecasting | Daily/monthly spend projections with trend lines |
| Budget alerts | Set per-project spend limits; get notified before you overshoot |
| Rate limit prediction | Live window tracking β know before you hit 429s |
| Per-session analytics | Group requests by session ID for agentic pipeline tracing |
| Model breakdown | Compare cost and latency across Haiku / Sonnet / Opus |
| Multi-project | Separate proxy keys per app, team, or environment |
| SDK-only mode | Proxy-free tracking β your key never leaves your server |
| AES-256-GCM encryption | Stored Anthropic keys encrypted at rest, never returned to browser |
| Dark mode | Because of course |
Your App
β
β ANTHROPIC_BASE_URL="http://your-claudetrack/proxy/v1"
β ANTHROPIC_API_KEY="cti_your_proxy_key"
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ClaudeTrack β
β β
β Express proxy βββΊ Token counter βββΊ Postgres β
β β β β
β βΌ βΌ β
β api.anthropic.com React dashboard β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Tech stack: Node.js Β· Express Β· React Β· Vite Β· PostgreSQL Β· Drizzle ORM Β· Recharts Β· shadcn/ui Β· Tailwind CSS
git clone https://github.com/your-org/claudetrack.git
cd claudetrack
cp .env.example .env
# Edit .env β set SESSION_SECRET at minimum
docker compose up -dDatabase is auto-provisioned. Share the URL with your team and you're done.
git clone https://github.com/your-org/claudetrack.git
cd claudetrack
npm install
cp .env.example .env
# Edit .env with your DATABASE_URL and SESSION_SECRET
npm run dev # development
npm run build && npm start # productionTrack Claude Code sessions by pointing its OpenTelemetry exporter at ClaudeTrack:
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:5000"
claude # sessions now appear in your ClaudeTrack dashboardInspired by the Resend / React Email playbook β standalone tools released separately to build community before the ecosystem matures:
claude-costβ CLI cost estimator.npx claude-cost --model sonnet --tokens 50000. No account, no proxy, just math.claude-ratelimitβ CLI rate limit calculator. Paste your usage tier, get a live window gauge.
If either of these sounds useful, upvote the issue or open a PR β they're designed to be beginner-friendly.
ClaudeTrack is community-driven. Every contributor becomes a maintainer-in-spirit.
Look for issues tagged good first issue β these are explicitly scoped, documented, and mentor-supported:
- Add Slack / Discord webhook for budget alerts
- CSV export for request log
- Per-model cost configuration (custom pricing)
- Claude Code OTEL receiver implementation
-
claude-coststandalone CLI (new repo) -
claude-ratelimitstandalone CLI (new repo)
git clone https://github.com/your-org/claudetrack.git
cd claudetrack
cp .env.example .env # fill in DATABASE_URL + SESSION_SECRET
npm install
npm run dev # http://localhost:5000Then open a PR. We review within 48 hours.
| Area | Skills needed |
|---|---|
| Claude Code OTEL receiver | Node.js, OpenTelemetry |
| Slack / webhook alerts | Node.js, REST APIs |
| Python SDK companion | Python |
| Documentation | Writing, diagrams |
| UI improvements | React, Tailwind |
If you're adding this repo to GitHub, use these topics for discoverability:
claude Β· anthropic Β· llm-observability Β· api-proxy Β· cost-tracking Β· token-tracking Β· rate-limiting Β· opentelemetry Β· self-hosted Β· developer-tools
- Proxy endpoint with token tracking
- Real-time dashboard with Recharts
- Budget alerts + rate limit prediction
- Per-session analytics
- AES-256-GCM key encryption
- Docker Compose self-hosting
- Slack / Discord alert webhooks
- Claude Code OTEL receiver
-
claude-costCLI (standalone) -
claude-ratelimitCLI (standalone) - Prometheus metrics endpoint
- Team access / multi-user
MIT β use it, fork it, sell it, build on it. Just keep the copyright notice.
If ClaudeTrack saves you money or debugging time, the best thank-you is a β star.
It helps other developers find this.
