# wei-shaw/claude-relay-service

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/wei-shaw-claude-relay-service).**

12,114 stars · 1,825 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/Wei-Shaw/claude-relay-service
- Homepage: https://pincc.ai
- awesome-repositories: https://awesome-repositories.com/repository/wei-shaw-claude-relay-service.md

## Topics

`claude` `claude-api` `claude-code` `claude-proxy` `codex-cli` `crs` `droid` `droid-cli` `droid2api` `gemini-cli`

## Description

This project is a secure intermediary proxy gateway for large language model APIs. It functions as a relay service that forwards requests to AI providers while managing service accounts and routing traffic.

The service provides a compatibility layer that supports multiple endpoint formats, allowing different third-party AI clients to communicate with a single provider. It distinguishes itself through a service account management system that assigns individual proxy settings to multiple accounts to prevent IP bans and distributes traffic via load balancing to avoid rate limits.

The system includes a rate limiter that restricts access based on token volume, concurrency, and custom identification keys. It monitors usage through a tracking system that records token consumption and request metrics per user. Reliability is maintained through a circuit-breaker mechanism that detects upstream connection failures and pauses routing to affected accounts using cooldown timers.

## Tags

### Web Development

- [Request Relays](https://awesome-repositories.com/f/web-development/api-management-tools/api-request-handling/request-relays.md) — Provides a secure intermediary relay layer that forwards incoming requests to remote AI providers. ([source](https://cdn.jsdelivr.net/gh/wei-shaw/claude-relay-service@main/README.md))
- [Endpoint Translation Maps](https://awesome-repositories.com/f/web-development/api-management-tools/api-development-management/web-apis/administrative-api-endpoints/endpoint-discovery/endpoint-translation-maps.md) — Translates various third-party API request formats into a single standardized internal format for upstream delivery.
- [Format Compatibility Layers](https://awesome-repositories.com/f/web-development/third-party-api-integrations/format-compatibility-layers.md) — Ships an endpoint prefixing system that ensures compatible communication between various third-party AI clients and providers. ([source](https://cdn.jsdelivr.net/gh/wei-shaw/claude-relay-service@main/README.md))

### Artificial Intelligence & ML

- [AI Gateway Management](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-gateway-management.md) — Provides centralized management of AI proxy settings, request rates, and token usage monitoring.
- [LLM Gateways](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-gateways.md) — Functions as a secure LLM API proxy gateway that aggregates multiple providers and manages service accounts.
- [API Compatibility Layers](https://awesome-repositories.com/f/artificial-intelligence-ml/api-compatibility-layers.md) — Exposes multiple endpoint formats via a compatibility layer to ensure different AI clients can communicate with one provider.

### DevOps & Infrastructure

- [AI Model Load Balancers](https://awesome-repositories.com/f/devops-infrastructure/traffic-load-balancers/ai-model-load-balancers.md) — Distributes AI API traffic across multiple service accounts to optimize rate limits and handle upstream failures.

### Networking & Communication

- [AI Provider Proxies](https://awesome-repositories.com/f/networking-communication/api-proxies/ai-provider-proxies.md) — Routes requests to Claude AI through a secure intermediary to manage service accounts and prevent IP bans.
- [Proxy Routing Services](https://awesome-repositories.com/f/networking-communication/proxy-routing-services.md) — Routes incoming traffic to specific service accounts based on account health and configured proxy settings.
- [Circuit Breakers](https://awesome-repositories.com/f/networking-communication/traffic-management-gateways/circuit-breakers.md) — Implements a circuit-breaker mechanism that pauses routing to failing upstream accounts using cooldown timers.
- [Circuit Breakers](https://awesome-repositories.com/f/networking-communication/traffic-routing-configurations/circuit-breakers.md) — Provides a circuit-breaker mechanism that detects upstream connection failures and pauses routing to affected accounts using cooldown timers. ([source](https://cdn.jsdelivr.net/gh/wei-shaw/claude-relay-service@main/README.md))

### Security & Cryptography

- [Usage-Based Access Restrictions](https://awesome-repositories.com/f/security-cryptography/domain-access-restrictions/request-access-restrictions/usage-based-access-restrictions.md) — Restricts API access based on request rates, token volume, concurrent connections, and client identifiers. ([source](https://cdn.jsdelivr.net/gh/wei-shaw/claude-relay-service@main/README.md))
- [Service Account Management](https://awesome-repositories.com/f/security-cryptography/service-account-management.md) — Implements a system for managing non-human service accounts and their associated proxy settings to avoid IP bans. ([source](https://cdn.jsdelivr.net/gh/wei-shaw/claude-relay-service@main/README.md))

### Software Engineering & Architecture

- [Rate Limiting](https://awesome-repositories.com/f/software-engineering-architecture/request-throttling/rate-limiting.md) — Enforces request and volume quotas based on token consumption metrics against unique user access keys.
- [Stateless Architectures](https://awesome-repositories.com/f/software-engineering-architecture/stateless-architectures.md) — Employs a stateless architecture to forward AI requests without storing conversation content on the server.

### System Administration & Monitoring

- [Token Usage Analytics](https://awesome-repositories.com/f/system-administration-monitoring/usage-monitoring/token-usage-analytics.md) — Tracks and records LLM token consumption and request counts per user for monitoring and access control.
- [Context Usage Monitors](https://awesome-repositories.com/f/system-administration-monitoring/usage-monitoring/context-usage-monitors.md) — Provides a monitoring dashboard to track token consumption and request metrics per user.

### Development Tools & Productivity

- [Third-Party Service Integrations](https://awesome-repositories.com/f/development-tools-productivity/third-party-service-integrations.md) — Connects diverse AI clients to a centralized relay service using custom access keys and compatible formats.
