tbphp/gpt-load

Self-hosted AI gateway for multi-channel, multi-credential setups — API keys and subscription accounts, scheduling, failover, request logs and usage. 自托管 AI 网关:多渠道多凭据统一接入,含密钥与订阅账号、调度容错、日志与用量。

What it solves

Managing multiple AI providers is messy: each has its own API keys, subscription accounts, and quirks. GPT-Load solves this by giving your application a single entry point — one base URL and one access key — while it handles all the upstream providers, credentials, and routing policy behind the scenes.

How it works

You deploy GPT-Load (via Docker or a native binary) and then configure it in three steps: add channels (upstream services like OpenAI, Anthropic, or subscription accounts like Codex), create groups to pick channels, models, and runtime policy, and generate an AccessKey for your app. The gateway then routes each request to an appropriate credential, doing traffic scheduling, retries, cooldown, health checks, and usage accounting. It supports native protocols from OpenAI, Anthropic, and Gemini, so your clients keep their familiar interfaces. All configuration happens in an embedded management UI, with data stored in SQLite (default), MySQL, or PostgreSQL, and credentials encrypted at rest.

Who it’s for

Developers and teams who need to centralize access to many AI providers — especially those juggling multiple API keys, subscription-based accounts, or both. It’s also for people who want self-hosted control, observability, and failure isolation without building their own gateway.

Highlights

  • Supports a wide range of providers: OpenAI, Anthropic, Gemini, xAI, Azure, Bedrock, Vertex, plus model services like DeepSeek, OpenRouter, Groq, and more
  • Handles both API-key channels and subscription channels (Codex, Claude, Antigravity, Grok) in one unified credential system
  • Built-in scheduling with configurable weights, automatic retries, cooldown, blacklisting, and session affinity to reduce impact of failing credentials
  • Embedded management UI with health checks, request logs, usage statistics, and cost estimates
  • Credential encryption with a dedicated encryption key (must be backed up with the database)
  • Deploy via Docker Compose or native binaries for Linux, macOS, and Windows; supports SQLite, MySQL, and PostgreSQL

Related

  • Project
  • Project
  • Project
  • Project
  • Project