ClaudeBridge: Self-Hosted Claude Pro Gateway

ClaudeBridge: Self-Hosted Claude Pro Gateway

19 views

Project Links

I built ClaudeBridge to solve a simple problem: I wanted to use my Claude Pro subscription across all my development tools without losing track of usage or hitting mysterious rate limits.

I also wanted to know how much was the subscription worth in practice.

What It Does

ClaudeBridge sits between your client and Claude Pro, exposing both OpenAI and Anthropic-compatible endpoints. Point any compatible client at it, and you will be able to use your existing subscription however you want.

Run the python module or the docker container and go through the Oauth routine. If you want the usage tracking in % as well, follow the instructions for the web polling.

Then decide how you wan to access the bridge: localhost or on on some kind of VPS, with or without application-level local API tokens. (I advise to use at least one: some clients do not handle well auth-less services from my tests)

I personally have the container running on one of my kubernetes instances with a tunneled tailscale sidecar to access something like claude.mytailnet.ts.net whereever I am.

Warning: the usage tracking can be a bit wonky mostly by design if you make use of your subscriptions both with and without the bridge at the same time

Observability

The application exposes a prometheus exporter endpoint so you can build or integrate in a dashboard on your own terms.

Grafana

Dashboard Overview

Web UI

Alternatively, the web usage is probabley good enough for simple monitoring.

  • Current session

Dashboard Overview

  • Previous session

Dashboard Overview

Every request is tracked: tokens in/out, cost estimates, session boundaries, and rate limits. You get real-time dashboards showing exactly where you stand in your 5-hour and 7-day usage windows.

Use Cases

That part depends on whether or not you want to break the ToS - something to keep in mind with the recent drama.

2 major uses cases:

With ClaudeCode

You want something like the popular ccusage that works across machines. Or maybe share you subscription with another user in your household.

In this case you are using the anthropic-like endpoints of ClaudeBridge and all the patterns (system prompts, options, tool names/format etc) should remain the same. I would imagine this behavior to be ToS-friendly because you are using the subscriptions with the official client, the bridge is just a proxy - sort of. simply do something like alias claude='ANTHROPIC_BASE_URL="your-bridge-machine" ANTHROPIC_API_KEY="the-key-from-the-web-ui" claude'

With anything else

Otherwise you can have as many users and non-anthropic applications on it and this may violate the ToS.

Here is ClaudePro connected to OpenAI's Codex

Dashboard Overview

Final word

So how much is on average the $20 subscription worth so far? about $143 USD.

  • The bridge has been stable for me the past 3+ month at the time I am writing this.
  • Open source and available on GitHub. Use your Claude Pro subscription on your terms.