Repolode
labring

labring/aiproxy

A Go-based AI gateway that exposes OpenAI, Claude and Gemini compatible endpoints and routes requests across multiple upstream model channels.

Open-source alternative to:OpenRouter

Stars
564
Forks
117
Open issues
17
Last commit
10 days ago

What is it?

AI Proxy is a gateway that sits between your applications and AI model providers. Clients send requests using the OpenAI Chat Completions, Claude Messages or Gemini protocol, and the proxy forwards them to configured upstream channels, with priority-based selection, retries on errors, and load balancing across providers.

Beyond routing, it includes multi-tenant management with per-group quotas, RPM and TPM limits, custom model pricing, and token-based access control with subnet restrictions. A management panel shows dashboards, request logs, error rates and cost analysis, and sends alerts for balance warnings and anomalies.

It also ships plugins for response caching (Redis or memory), web search via Google, Bing and Arxiv, splitting reasoning content from <think> tags, and streaming internally for non-streaming requests to avoid timeouts. MCP server integration and protocol conversion to the Responses API are also supported.

Key features

  • 01Accepts OpenAI, Claude and Gemini protocols and converts to the Responses API for responses-only models
  • 02Priority-based channel selection with retries and load balancing across providers
  • 03Multi-tenant groups with RPM/TPM limits, quotas and custom per-model pricing
  • 04Management panel with request logs, error-rate analysis and cost statistics
  • 05Plugins for caching, web search, reasoning-content splitting and stream fallback

Use cases

  • Giving internal applications one OpenAI-style endpoint in front of several model providers
  • Letting tools such as Claude Code, Gemini CLI or Codex use models from other providers through a local proxy
  • Managing API access, quotas and billing for multiple teams or customers from one gateway

Quick start

  1. 1

    Run AI Proxy with Docker (default configuration)

    docker run -d \ --name aiproxy \ -p 3000:3000 \ -v $(pwd)/aiproxy:/aiproxy \ -e ADMIN_KEY=your-admin-key \ ghcr.io/labring/aiproxy:latest
  2. 2

    Open the management panel and API explorer at localhost:3000 (Swagger at /swagger/index.html)

Things to know

  • Building from source requires Go 1.24+ and Node.js 22+ for the optional frontend.
  • Configuration relies on many environment variables, so initial setup takes some effort.

Topics

FAQ

What is aiproxy?
A Go-based AI gateway that exposes OpenAI, Claude and Gemini compatible endpoints and routes requests across multiple upstream model channels. AI Proxy is a gateway that sits between your applications and AI model providers. Clients send requests using the OpenAI Chat Completions, Claude Messages or Gemini protocol, and the proxy forwards them to configured upstream channels, with priority-based selection, retries on errors, and load balancing across providers.
Is aiproxy free to use? What license does it have?
aiproxy is open source under the MIT license. Check the license terms before using it in commercial products.
Is aiproxy still maintained?
Actively maintained. The last commit to aiproxy was on Oct 12, 2026.
What can I use aiproxy for?
Giving internal applications one OpenAI-style endpoint in front of several model providers Letting tools such as Claude Code, Gemini CLI or Codex use models from other providers through a local proxy Managing API access, quotas and billing for multiple teams or customers from one gateway
How do I install aiproxy?
Run AI Proxy with Docker (default configuration): docker run -d \ --name aiproxy \ -p 3000:3000 \ -v $(pwd)/aiproxy:/aiproxy \ -e ADMIN_KEY=your-admin-key \ ghcr.io/labring/aiproxy:latest Open the management panel and API explorer at localhost:3000 (Swagger at /swagger/index.html)
Where can I get aiproxy?
The source code and installation instructions are on GitHub: https://github.com/labring/aiproxy

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects