Open-source proxy to track Claude API costs by team
Drop-in Claude API proxy with real-time cost dashboard—but Anthropic's own billing UI exists.
Use your Claude Max / ChatGPT Pro subscription as an API. Self-hosted Express + Bun HTTP bridge that wraps the Claude Code CLI and OpenAI Codex CLI into an authenticated REST API with SSE streaming, hashed API keys, per-user rate limits, token & cost tracking, request logs, and an admin dashboard.
Per-token cost caps on subscription-backed keys—solves a real billing pain for teams.
Teams with shared Claude Max/OpenAI Pro subscriptions managing internal AI testing
Anthropic API key management · OpenAI API usage dashboards
So I built a bridge: it wraps the Claude Code CLI and Codex CLI behind an Express API, backed by existing Max/Pro subscriptions instead of per-token billing. Each team member gets their own API key with hard limits — requests/day, tokens/month, cost caps. Hit the limit and the key stops working. No surprises. An admin dashboard shows who's using what in real time.
Key features: - Two providers: /generate (Claude) and /generate-codex (Codex) - Per-user API keys with SHA-256 hashing (shown once, never stored raw) - Per-key hard limits with real-time tracking and enforcement - Admin dashboard for key management, usage monitoring, and request logs - Deploy on a $5 VPS behind Cloudflare Tunnel
What it's NOT: A production API replacement. It's for internal tooling and prototyping. CLI invocations add ~3-8s latency vs direct API calls.
Important: Wrapping CLI subscriptions behind a shared API may violate the Terms of Service of the underlying providers. Anthropic's Consumer ToS (updated Feb 2026) prohibits using subscription OAuth tokens in third-party tools, and OpenAI's ToS prohibits account sharing. Review the applicable terms before using this. See the Disclaimer section in the README for details.
Security was a focus: execFile (no shell injection), timing-safe auth, CSP/HSTS, input validation, rate limiting. Details in SECURITY.md.
Stack: Node.js, TypeScript, Express. No database — JSON files on disk.
GitHub: https://github.com/Shreyas-Dayal/ai-cli-bridge
Would love feedback on the approach and any security concerns I might have missed.
Drop-in Claude API proxy with real-time cost dashboard—but Anthropic's own billing UI exists.
Provider-enforced caps mean rogue agents literally cannot exceed your budget.
Clever use of Claude Channels to push messages—nobody else bridged these two agents yet.
Smart key management via 1Password keeps secrets out of Claude's context window.
Simple wrapper preventing runaway agent costs before they hit your credit card.
Yet another AI writing extension, but bring-your-own API keys saves subscription costs.