Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

aimod-cc/Agent2API

AI Engineering

Self-hosted AI routing gateway that unifies model APIs and manages local agent client connections.

2,226
586
Rust
AGPL-3.0
2 months old

What it does

Agent2API is a self-hosted gateway that puts multiple AI providers behind one base URL. It exposes OpenAI Chat, Responses and Images endpoints plus Anthropic Messages, with a shared model catalog, model mapping, account priority, load balancing, session affinity and failover. On top of the API layer it manages connection profiles for local agent clients: existing settings can be imported, switched and previewed before writing, so the same client can point at the gateway or another service.

The panel adds account-level operations — credential maintenance, egress proxy selection, scheduled check-in per provider, gateway keys and a request report covering volume, success rate, token usage, cache hit rate and a 365-day activity heatmap. It ships as a desktop app (Windows/macOS/Linux), a headless server package (Windows/Linux) and a Docker image for amd64/arm64, with a mobile PWA view.

Quick start

Pick a deployment form. For Docker:

docker run -d --name agent2api --restart unless-stopped -p 3065:3065 -v ./data:/data aimodcc/agent2api:latest

The Linux server archive is extracted and installed as a system service with sudo bash install.sh; the Windows Server archive uses install-service.ps1 from an administrator PowerShell. Other artifacts (.exe, .dmg, .deb, .AppImage, server tarballs, APK/IPA) are listed in the latest release, and the full install, upgrade and uninstall guide is the installation documentation.

After starting, open the panel at http://127.0.0.1:3065/ (host IP for server or Docker), register the admin account, add a custom provider and account, then create a key under "Gateway Keys". Point a client at http://127.0.0.1:3065/v1 with that key, or apply a connection profile on the Agent page. Check reachability with curl http://127.0.0.1:3065/health. Model requests are refused until a gateway key exists.

The mobile view is available at /m on the gateway address and can be added to the home screen as a PWA.

Constraints

  • Extra provider implementations are distributed as separately installed plugins; the gateway without a plugin handles custom providers only.
  • Panel sign-in can require human verification, and gateway keys are scoped, so clients need a key issued from the panel rather than an open endpoint.
  • Account credentials are encrypted in the local database, but exports, backups and key files may contain sensitive data and must be kept private.
  • The desktop build needs Rust >= 1.77 with the Tauri 2 toolchain; building the macOS .dmg is only possible on macOS, and Windows builds need the WebView2 runtime. Node.js >= 18.17 is used only for build scripts, not at runtime.
  • Licensed under AGPL-3.0, including the network-use source obligation for modified versions. The project explicitly offers no availability, stability or security guarantee.

HotRepo's take

On the 2026-11-13 Rust daily list the repository recorded 56 new stars and a best position of 10, alongside 2,218 stars and 585 forks overall. That single snapshot shows it competing in the Rust language ranking for that day, but there is no all-language daily rank on record and only one snapshot, so it does not establish a trend. The README's core differentiator — taking over existing agent-client configuration while routing many providers through one endpoint — is a concrete, checkable capability rather than a pure link page, and the AGPL-3.0 license plus Docker and server distribution make self-hosting the intended path.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

You might also like

  1. jasonxu114514/opencode2apiA self-hosted gateway that puts OpenAI, Responses and Anthropic APIs in front of OpenCode Zen, with key and proxy pooling.Go1,264
  2. do-whilefor/zcode2apiSelf-hosted gateway that reshapes ZCode free-account access into OpenAI- and Anthropic-compatible APIs.Go106
  3. cheaper-inference/OmniRouteA self-hosted AI gateway that unifies hundreds of providers behind one OpenAI-compatible endpoint with routing, fallback, and token compression.TypeScript83,759