OpenSource-Hub
S

sub2api

SHA-256
38.8k stars·Developer Tools·SHA-256 checksum verified

An open-source AI API gateway that unifies Claude, OpenAI, Gemini, and Grok subscriptions into a single API. Supports subscription sharing (car-pooling) to lower costs, with seamless integration into native coding tools. Go + Vue based, Docker-ready.

Smart Download

Download Download Version

v0.1.179 · 35.6 MB

Pool Claude, OpenAI, Gemini, and Grok subscriptions into one unified API gateway with cost-sharing and seamless native tool integration.

Core Features

  • Multi-subscription aggregation: Connect Claude / OpenAI / Gemini / Grok subscriptions with unified OpenAI-compatible API output
  • Car-pooling mechanism: Share one subscription across multiple users with quota-based cost allocation
  • Native tool compatibility: Works out-of-the-box with Claude Code, Codex, Gemini CLI and other AI coding tools
  • Self-hosted deployment: One-click Docker deployment with PostgreSQL + Redis production-grade architecture
  • Web management dashboard: Vue 3 powered panel for member management, quota allocation, and usage analytics

What It Can't Do

  • Using this project may violate the terms of service of Anthropic and other upstream providers, leading to account bans at your own risk
  • For technical learning and research only; comply with local laws and regulations; commercial operation is strictly prohibited
  • No commercial authorization has been granted by the developers; watch out for paid services operating under the sub2api name
  • Read the disclaimer in the README carefully before deploying

Use Cases

  • Team collaboration: Share one Claude subscription across a team through an internal API gateway with transparent cost allocation
  • Solo developers: Unify multiple platform subscriptions into one API Key for seamless switching between AI coding tools

Detailed Introduction

Sub2API is an open-source AI API gateway platform that consolidates multiple AI subscription services — Claude, OpenAI, Gemini, and Grok — into one unified API endpoint. Its core innovation is subscription quota distribution and car-pooling: multiple users can share a single subscription, dramatically reducing per-user costs. Unlike traditional API relay projects like One API that focus mainly on token-based billing and key management, Sub2API natively handles OAuth-based subscription connections, making it ideal for sharing official subscriptions across a team. It works seamlessly with Claude Code, Codex, Gemini CLI, and other OpenAI-compatible clients, and offers both a managed website and self-hosted deployment via Docker. The stack includes Go 1.26, Vue 3, PostgreSQL 15+, and Redis 7+.

Tags

AI GatewayAPI RelayClaude CodeSubscription SharingDocker

Getting Started

1

Download installer

Click the button above to download the installer for your system

2

Install the software

Double-click the downloaded installer and follow the prompts

3

Deploy with Docker Compose: create docker-compose.yml and configure PostgreSQL and Redis connection settings

4

Obtain the OAuth token from your official Claude / OpenAI / Gemini subscription

5

Add the subscription in the admin panel, set car-pooling quotas, and generate your own API Key

Install Guide
  1. Deploy with Docker Compose: create docker-compose.yml and configure PostgreSQL and Redis connection settings
  2. Obtain the OAuth token from your official Claude / OpenAI / Gemini subscription
  3. Add the subscription in the admin panel, set car-pooling quotas, and generate your own API Key
File Integrity

SHA-256 checksum verified

Checksum extracted from GitHub official Release page

SHA256 Checksum

ae6b2e7ae30d784e7d7cbda119bcbc0b70f8e9334570f958bb255dad453adc17

This checksum is extracted from the GitHub Release page. Verify file integrity after download.

All SHA-256 checksums on this platform are extracted from the project's official GitHub Release page, without any modification. You can independently verify them on the GitHub Releases page.

Open Source Transparency

View GitHub Source
Environment Guide

Uninstall Info

For Docker deployments, run docker compose down to stop and remove containers. To fully clean data, remove related Docker volumes with docker volume rm. For source deployments, delete the source directory along with the corresponding PostgreSQL database and Redis data.

No Extra Dependencies

Ready to use after download. No additional runtime required.

Project Info
LicenseLGPL-3.0
Last Updated2026-08-23T03:14:24Z
GitHub RepositoryOfficial Website

Similar Projects