explaingit

wei-shaw/claude-relay-service

11,694JavaScriptAudience · developerComplexity · 4/5Setup · moderate

TLDR

A self-hosted relay server that lets a small team share one or more Claude AI accounts, giving each person their own API key with individual usage tracking and rate limits.

Mindmap

mindmap
  root((claude-relay-service))
    What it does
      Shares Claude accounts
      Rotates API requests
      Tracks token usage
    Setup
      Node.js runtime
      Redis cache
      Docker deploy
    Management
      Web admin panel
      Per-key rate limits
      Model restrictions
    Providers
      Anthropic Claude
      Google Gemini
      OpenAI compatible
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Share a single Claude Code Max subscription among 3, 5 teammates, each using a personal API key issued by the relay server.

USE CASE 2

Track per-user token consumption and set model access restrictions for each key from a web admin panel.

USE CASE 3

Route requests across multiple AI providers (Claude, Gemini, OpenAI-compatible) through a single unified endpoint.

Tech stack

JavaScriptNode.jsRedisDocker

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a running Redis instance and an Anthropic account, must update to v1.1.249 or later to avoid a critical admin-panel authentication bypass vulnerability.

In plain English

This project is a self-hosted relay server that sits between users and Anthropic's Claude API. Instead of each person on a team paying separately, one person runs this service on a private server, connects multiple Claude accounts to it, and shares access with others through individual API keys. The server rotates requests across the connected accounts, tracks how many tokens each user has consumed, and gives each user their own rate limits and model restrictions. The practical audience the README describes is small groups, such as three to five friends who want to split the cost of a Claude Code Max subscription. Each person gets a personal API key from the relay service, then points their local Claude Code tool at the relay server instead of Anthropic directly. The relay forwards requests to whichever connected Claude account is currently available. The service is written in JavaScript and runs on Node.js with Redis for caching and session state. It includes a web management panel where the administrator can add Claude accounts, create API keys, view usage statistics, set per-key rate limits and concurrency caps, and restrict which AI models each key can access. Docker and a one-command install script are both available for deployment. The README opens with a prominent security warning: versions 1.1.248 and below had a serious vulnerability that let attackers access the admin panel without valid credentials. Users are told to update to version 1.1.249 or later, or to migrate to a successor project called CRS 2.0. The README also carries a clear disclaimer that using this tool may violate Anthropic's terms of service, and that any consequences such as account suspension are the user's responsibility alone. The project is described as intended for technical learning and research. The service also supports Gemini and other OpenAI-compatible providers, so it can act as a unified relay for multiple AI providers under a single endpoint.

Copy-paste prompts

Prompt 1
Set up claude-relay-service on my VPS using Docker so my team of 4 can share one Claude account, show me the docker-compose.yml and the steps to create API keys in the admin panel.
Prompt 2
Write the environment config to point my local Claude Code CLI at a relay server instead of Anthropic's API directly using a custom base URL.
Prompt 3
Help me configure per-key rate limits and concurrency caps in claude-relay-service so no single user can consume the entire quota.
Prompt 4
Generate a checklist to verify I am running claude-relay-service v1.1.249 or later and am not exposed to the admin-panel authentication bypass vulnerability.
Open on GitHub → Explain another repo

← wei-shaw on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.