Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsJul 2, 2026·2 min de lectura

Sub2API — Unified Relay for Multiple AI Subscription Endpoints

An open-source relay platform that unifies Claude, OpenAI, Gemini, and other AI subscriptions into a single API endpoint with account sharing support.

Listo para agents

Instalación con revisión previa

Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.

Needs Confirmation · 66/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Sub2API
Comando con revisión previa
npx -y tokrepo@latest install cf58cb67-7631-11f1-9bc6-00163e2b0d79 --target codex

Primero dry-run, confirma las escrituras y luego ejecuta este comando.

Introduction

Sub2API is an open-source relay platform written in Go that consolidates multiple AI provider subscriptions into a single unified API endpoint. It supports Claude, OpenAI, Gemini, and other providers, enabling teams to share and manage AI access through one gateway.

What Sub2API Does

  • Proxies requests to multiple AI providers through a single endpoint
  • Supports load balancing across multiple subscription accounts
  • Provides token usage tracking and quota management per account
  • Offers an OpenAI-compatible API format for broad tool compatibility
  • Enables team access sharing with per-user rate limiting

Architecture Overview

Sub2API is a stateless Go binary that acts as a reverse proxy. Incoming API requests are routed to the appropriate provider based on model name and configuration rules. Account credentials are stored in a YAML config file and rotated automatically when rate limits are hit. The relay translates between provider-specific API formats and presents a unified OpenAI-compatible interface.

Self-Hosting & Configuration

  • Build from source with Go 1.21+ or use pre-built Docker images
  • Configure provider accounts and credentials in config.yaml
  • Set per-account rate limits and priority ordering
  • Enable optional authentication for downstream clients
  • Deploy behind a reverse proxy for TLS termination

Key Features

  • Single endpoint for Claude, OpenAI, Gemini, and more
  • Automatic failover and load balancing across accounts
  • OpenAI-compatible API format for broad tool compatibility
  • Per-user and per-account usage tracking
  • Lightweight Go binary with minimal resource requirements

Comparison with Similar Tools

  • LiteLLM — Python-based proxy with more features; Sub2API is Go-native and lighter
  • OpenRouter — managed service; Sub2API is fully self-hosted
  • Portkey AI Gateway — enterprise-focused; Sub2API is simpler to deploy
  • one-api — similar concept; Sub2API focuses on subscription-based account management

FAQ

Q: Does Sub2API store my API keys securely? A: Keys are stored in the config file. Use file permissions and secrets management for production deployments.

Q: Can I use it with tools that expect an OpenAI API? A: Yes. Sub2API exposes an OpenAI-compatible endpoint, so most tools work without modification.

Q: How does load balancing work? A: Requests are distributed across configured accounts based on priority and remaining quota.

Q: Is there a web dashboard? A: The project focuses on the API relay. Usage metrics are available via API endpoints for integration with external dashboards.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados