convez.ai
MCP ServerIntegração & APIsIntermediário
cuihuan

Awesome AI Gateway

cuihuan/awesome-ai-gateway

Escolha o gateway de IA ideal em 10 segundos com dados atualizados diariamente

Ver no GitHub
BomPluginScore · de 0 a 100

Lista curada e atualizada diariamente de gateways de IA e proxies LLM (LiteLLM, OpenRouter, Portkey, Kong, Higress, new-api) com comparação por custo, conformidade, self-hosting e roteamento. Inclui árvore de decisão interativa, benchmarks reproduzíveis e snippets prontos para uso.

Instalação

$npx convez-ai cuihuan/awesome-ai-gateway

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
158
Forks
159
Acompanhando
1
Saúde
71%
Último commit
há 1 dia
Versão
v1.1.0
Issues abertas
40
Contribuidores
3

Casos de uso

  • Comparar custos entre diferentes gateways de LLM
  • Selecionar solução ideal entre hosted vs self-hosted
  • Otimizar gastos com IA reduzindo despesas desnecessárias
  • Implementar roteamento inteligente entre modelos e provedores

Veredito

Recurso valioso para quem precisa navegar o ecossistema fragmentado de gateways de IA. A abordagem prática (com benchmarks reais e árvore de decisão) evita hype, mas funciona melhor como repositório de referência do que como MCP server integrado.

README

A tradução para o português deste README ainda está na fila.

Awesome AI Gateway Awesome

GitHub stars Evaluation set Data updated daily

Pick the right AI gateway for your need in ~10 seconds — then trust the answer. A decision tree, a drop-in snippet, a reproducible cost benchmark, and independent evidence for what we exclude. Organized by what you actually need, not by vendor.

Built the hard way: I burned $788 on AI coding in a single day — one flagship model ate 78% of it, just because I'd defaulted everything to the priciest option. So I mapped the whole gateway landscape. → the story

Languages: English · 简体中文

PRs Welcome License: CC0 Last commit

Pick fast · Which gateway should I use? · Quick start (drop-in) · Quick comparison

Browse by need · 💰 Cost-first · 🔓 Self-hosted · 🏢 Enterprise & compliance · ☁️ First-party clouds · 🇨🇳 China ecosystem · 🤖 MCP & agent gateways

Reference · 📊 Evaluation set · How to choose safely · FAQ · 📚 Essential reading · 📰 What's new · Glossary · Why this exists · Contributing

Which gateway should I use?

⚡ Fast answer — one sane default per need (alternatives in each linked section):

I need…Start withDrill into
Cheapest access to many models, zero opsOpenRouterCost-first
Zero markup on my own keysVercel / CloudflareCost-first
Self-host, broadest featuresLiteLLMSelf-hosted
Self-host, lowest overheadBifrost (Go)Self-hosted
China models + team key billingnew-apiChina ecosystem
Enterprise K8s + auditKong / HigressEnterprise
Strongest compliance (HIPAA/FedRAMP)Azure / BedrockFirst-party
Govern agents / MCP trafficagentgatewayMCP & agents
Do you want to self-host?
│
├─ NO — hosted, minimal ops
│   ├─ Cheapest access to many models ──────────▶ OpenRouter · Vercel AI Gateway (0% markup)
│   ├─ Free control plane over your own keys ───▶ Cloudflare AI Gateway
│   ├─ EU data residency matters ───────────────▶ Requesty · Eden AI · nexos.ai
│   └─ Already on one cloud ────────────────────▶ AWS Bedrock · Azure APIM · Vertex AI
│
└─ YES — self-hosted / open source
    ├─ Python stack, broadest features ─────────▶ LiteLLM
    ├─ Raw performance (Go/Rust/TS) ────────────▶ Bifrost · Portkey Gateway
    ├─ Built-in evals + observability ──────────▶ Helicone · Portkey Gateway
    ├─ Key distribution / billing / CN models ──▶ new-api · one-api · GPT-Load
    ├─ Enterprise K8s, audit, guardrails ───────▶ Kong · Higress · APISIX · Envoy AI Gateway
    └─ Governing AI agents & MCP traffic ───────▶ agentgateway · Lunar.dev

✅ Why trust this list

  • Independent — no vendor money, no affiliate links, CC0. Unlike affiliate-driven relay "rankings," nobody pays to appear here.
  • Reproducible, not asserted. Every cost cell is computed from open pricing data by a unit-tested script; stars refresh daily via CI.
  • Honest about risk. We disclose CVEs, label archived/stale projects, and exclude gray-market relays — with the research to back it.

Why this matters: the same task can cost 100× more depending on the model behind your gateway. An AI gateway sits between your code and LLM providers — one endpoint, one key, many models — handling routing, failover, caching, rate limits, cost tracking and guardrails, so you change a base_url instead of rewriting your app. Pick the gateway here, then the evaluation set shows which model to route to.

⭐ Found this useful? Star it — that's how the next engineer choosing a gateway finds it. CC0, no signup, no tracking, no vendor money.

Quick start (drop-in)

The whole promise of a gateway: change base_url, keep your OpenAI code. Same request, now with routing, fallback, caching and cost tracking.

from openai import OpenAI

# Hosted example — OpenRouter (400+ models, one key):
client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="sk-or-...",
)

# Self-hosted example — a LiteLLM proxy you run:
client = OpenAI(
    base_url="http://localhost:4000",
    api_key="sk-litellm-...",
)

resp = client.chat.completions.create(
    model="anthropic/claude-fable-5",        # ask the gateway for any provider's model
    messages=[{"role": "user", "content": "Hello!"}],
)

OpenAI-compatible base_url cheat sheet (verified June 2026 — swap in, keep your code):

Gatewaybase_url
OpenRouterhttps://openrouter.ai/api/v1
Vercel AI Gatewayhttps://ai-gateway.vercel.sh/v1
Cloudflare AI Gatewayhttps://gateway.ai.cloudflare.com/v1/{account}/{gateway}/compat
Portkeyhttps://api.portkey.ai/v1
Helicone AI Gatewayhttps://ai-gateway.helicone.ai/ai
Requestyhttps://router.requesty.ai/v1
LiteLLM (self-hosted)http://localhost:4000

Quick comparison

Stars auto-refresh daily. ✅ built-in · ➕ via plugin/paid tier · ❌ not available.

ProjectTypeStarsLicenseMulti-providerFallback / LBCachingGuardrailsCost tracking
LiteLLMOSS proxy + SDK⭐ 50.5kMIT¹✅ 100+✅✅✅✅
new-apiOSS relay/billing⭐ 39kAGPL-3.0✅✅➕➕✅
one-apiOSS relay/billing⭐ 35kMIT✅✅❌❌✅
Kong AI GatewayOSS API gateway⭐ 43.6kApache-2.0✅✅✅ semantic✅✅
Apache APISIXOSS API gateway⭐ 16.7kApache-2.0✅✅➕➕➕
Portkey GatewayOSS gateway + SaaS⭐ 12.1kMIT✅ 1600+✅✅✅ 50+➕ SaaS
TensorZeroOSS LLMOps · ⚠️ archived '26⭐ 11.6kApache-2.0✅✅✅➕✅
HigressOSS AI-native gateway⭐ 8.7kApache-2.0✅✅✅✅✅
GPT-LoadOSS key-pool proxy⭐ 6.2kMIT✅✅ key rotation❌❌➕
BifrostOSS gateway (Go)⭐ 5.8kApache-2.0✅✅ adaptive✅✅✅
HeliconeOSS observability + gateway⭐ 5.8kApache-2.0✅✅✅➕✅
Envoy AI GatewayOSS K8s gateway⭐ 1.8kApache-2.0✅✅➕➕✅
OpenRouterSaaS marketplace—Commercial✅ 400+✅✅➕✅
Vercel AI GatewaySaaS (0% markup)—Commercial✅ 100s✅❌❌✅
Cloudflare AI GatewaySaaS control plane—Commercial (free tier)✅✅ dynamic✅✅✅ budgets

¹ LiteLLM core is MIT; the repo contains a separately licensed enterprise directory.

📂 Browse the raw data (machine-readable, CC0): models & pricing JSON · cost table CSV · gateway scorecard CSV. Every cost cell is regenerated from this data by a unit-tested script.

The full directory at a glance — browse the sections below by your need.

💰 Cost-first: cheapest multi-model access

Pain point: "I want many models for the least money and zero ops."

  • OpenRouter — The dominant model marketplace: 400+ models behind one OpenAI-compatible API, pay-as-you-go with automatic failover; ~5.5% fee when buying credits. $113M Series B (May 2026), ~8M users.
  • Vercel AI Gateway — Hundreds of models at provider list price (0% markup), $5/month free credits, zero-data-retention option; pairs naturally with the AI SDK.
  • Cloudflare AI Gateway — Free control plane in front of your own provider keys: caching, dynamic routing, unified billing, and dollar-denominated spend limits (2026 beta).
  • Requesty — EU-friendly OpenRouter alternative: 400+ models, sub-20ms failover, ~5% markup.
  • Eden AI — Unified API for 500+ models plus vision/OCR/speech; EU-based, ~5.5% platform fee.
  • Helicone AI Gateway (cloud) — Passthrough billing at 0% markup with observability bundled.
  • GPT-Load ⭐ 6.2k — High-performance Go proxy that rotates pools of API keys across channels to maximize quota usage.
  • Loop Gateway — OpenAI-compatible proxy that meters every request in Bitcoin sats instead of dollars. 311 models via OpenRouter at a 15% markup. No accounts, no email, no card; top up over Lightning, get a bearer token. Three auth rails (prepaid bearer, L402, Cashu). Self-hostable in Go via docker-compose, live at api.loopxxi.com.
  • AIMLAPI — One OpenAI/Anthropic-compatible endpoint fronting 400+ models (chat, image, video, audio, embeddings); prepaid, OpenRouter-style aggregator.
  • Novita AI — Unified API to 200+ open-source models (DeepSeek/Qwen/Llama…) with load balancing, autoscaling and failover; also a GPU cloud.
  • Glama Gateway — OpenAI-compatible gateway to 100+ models with consolidated billing, caching and logging (OSS core glama-ai/lightport).

💡 Squeeze more from any gateway: enable semantic caching (Kong, Bifrost, Zuplo), set spend limits (Cloudflare, Zuplo, Pydantic/Logfire), and route easy prompts to cheap models (see Smart routing).

🔓 Self-hosted open source

Pain point: "My keys, my infra, no per-token middleman fee."

  • LiteLLM ⭐ 50.5k — The default choice: Python SDK + proxy server speaking OpenAI format to 100+ providers, with virtual keys, budgets, load balancing and guardrails.
  • Portkey Gateway ⭐ 12.1k — Fast TypeScript gateway (1,600+ models, 50+ guardrails) that also powers Portkey's commercial LLMOps platform.
  • TensorZero ⭐ 11.6k — ⚠️ Archived June 2026 (company wound down; repo read-only, Apache-2.0 code + community forks remain). Rust gateway unified with observability, evals, experimentation and optimization.
  • Bifrost ⭐ 5.8k — Go gateway from Maxim AI claiming ~50x LiteLLM throughput; adaptive load balancing, cluster mode, MCP support.
  • Helicone ⭐ 5.8k — Observability-first platform (YC W23) with a Rust ai-gateway ⭐ 602.
  • Plano ⭐ 6.6k — AI-native proxy and data plane for agents (formerly Arch Gateway / archgw).
  • LLM Gateway ⭐ 1.3k — Open-source OpenRouter alternative: route, manage and analyze requests across providers.
  • APIPark ⭐ 1.8k — Cloud-native LLM API management and distribution platform.
  • Pydantic AI Gateway ⭐ 189 — BYOK gateway with cost caps and OTel; ⚠️ repo archived, now folded into Pydantic Logfire.
  • OptiLLM ⭐ 4.1k — Optimizing inference proxy that boosts accuracy via test-time compute techniques.
  • aisuite ⭐ 14.6k — Andrew Ng's unified multi-provider client. A library rather than a deployable proxy — fits when you don't want network hops.
  • Shepherd Model Gateway (SMG) ⭐ 333 — Engine-agnostic gateway in Rust: one OpenAI/Anthropic-compatible endpoint over vLLM/SGLang/TRT-LLM + cloud providers, with KV-cache-aware routing and WASM plugins.
  • RelayPlane ⭐ 180 — MIT, local-first proxy (npm): 11 providers behind one endpoint with per-request cost attribution and hard daily/hourly budget caps.
  • SentryNode Gateway ⭐ 0 — Open-core (Apache-2.0) AI proxy focused on cost governance / FinOps routing, with budget caps and audit logging.
  • ⚠️ Stale but historically notable: BricksLLM ⭐ 1.2k (PII masking, per-key limits; inactive since early 2025), Glide ⭐ 160 (inactive since 2024).

🏢 Enterprise & compliance

Pain point: "Audit logs, PII redaction, RBAC, on-prem, and the EU AI Act (enforceable Aug 2026)."

  • Kong AI Gateway ⭐ 43.6k — Mature API gateway with AI plugins: semantic caching/routing, prompt guard, token rate-limiting; Konnect for managed control plane.
  • Apache APISIX ⭐ 16.7k — Cloud-native API + AI gateway with ai-proxy / ai-proxy-multi plugins.
  • Envoy AI Gateway ⭐ 1.8k — CNCF-aligned GenAI access on Envoy Gateway, backed by Tetrate and Bloomberg.
  • kgateway ⭐ 5.6k — CNCF API/AI gateway, the base of Solo.io's commercial Gloo AI Gateway.
  • TrueFoundry AI Gateway — Enterprise gateway with routing, guardrails and RBAC, deployable into your K8s/VPC.
  • nexos.ai — Enterprise AI gateway/orchestration from the Nord Security founders (€30M Series A, Oct 2025).
  • Tyk AI Studio — AI governance suite: budgets, model catalogs, guardrails on Tyk's gateway.
  • Gravitee Agent Mesh — LLM Proxy, MCP Proxy and A2A support inside Gravitee APIM.
  • WSO2 AI Gateway — Egress management for LLM traffic: model routing, semantic caching, guardrails.
  • F5 AI Gateway — Containerized AI traffic gateway; data-leakage detection via the LeakSignal acquisition (Nov 2025).
  • IBM API Connect AI Gateway — Policy enforcement, masking and audit for LLM traffic.
  • MuleSoft AI / Omni Gateway — Governs LLM, MCP and agent traffic alongside classic APIs.
  • Lunar.dev ⭐ 455 — Egress consumption gateway repositioned around MCP/agent governance.
  • KrakenD AI Gateway — High-performance, stateless Go API gateway (krakend/krakend-ce ⭐ 2.6k) with an AI proxy + prompt-security layer.
  • Broadcom Layer7 AI Gateway — LLM traffic governance, threat protection and quotas on the mature Layer7 API platform.
  • Cequence AI Gateway — API-security-first AI gateway: discovery, guardrails and threat protection for LLM/agent traffic.

☁️ First-party gateways (cloud & model vendors)

Pain point: "We're already committed to one cloud — give us the native path."

🇨🇳 China ecosystem

Pain point: "Domestic models (Qwen/DeepSeek/GLM/Kimi), CNY payment, key distribution & billing for teams."

  • new-api ⭐ 39k — The most active one-api fork, now a "unified AI model hub": protocol conversion, billing, Rerank/Realtime endpoints. AGPL-3.0.
  • one-api ⭐ 35k — The original LLM API 管理&分发系统 (OpenAI/Azure/Claude/Gemini/DeepSeek/豆包…); development has slowed.
  • Higress ⭐ 8.7k — Alibaba's AI-native gateway on Envoy/Istio, first-class 通义/DeepSeek support; hosted version at higress.ai.
  • GPT-Load ⭐ 6.2k — 智能密钥轮询 multi-channel proxy in Go.
  • one-hub ⭐ 2.8k — one-api fork with better non-OpenAI function calling and stats.
  • simple-one-api ⭐ 2.3k — Single binary adapting 千帆/星火/混元/MiniMax/DeepSeek to the OpenAI interface.
  • Veloera ⭐ 1.6k — Newer relay platform in the one-api/new-api lineage.
  • uni-api ⭐ 1.2k — Lightweight single-config unified API manager, no frontend.
  • APIPark ⭐ 1.8k — China-origin, cloud-native AI & API gateway with an open developer portal.
  • VoAPI ⭐ 1.1k — Polished new-api-lineage relay/billing panel (Go), focused on UI and operations.
  • done-hub ⭐ 771 — one-api/new-api fork with richer billing and channel management.
  • Volcengine AI Gateway — ByteDance's cloud AI gateway: unified access, routing and governance for Doubao + third-party models.

⚠️ This list deliberately excludes reverse-engineered / resold "free-api" relays — and not on principle alone. Two 2026 measurement studies found systematic fraud across the relay population: Real Money, Fake Models measured model-identity failures in 45.8% of fingerprint tests and output divergence up to 47%; Your Agent Is Mine caught routers injecting malicious code and exfiltrating planted API keys. If you're forced to vet one anyway, use the canary-diff test in How to choose safely.

🤖 MCP & agent gateways

Pain point: "Agents call tools now — govern MCP traffic like you govern APIs." The newest category (2025–2026).

  • agentgateway ⭐ 3.3k — CNCF proxy for agentic traffic: MCP governance and agent-to-agent (A2A) communication.
  • Lunar.dev MCPX ⭐ 455 — Gateway for managing MCP server consumption.
  • Tetrate Agent Router Service — Managed Envoy AI Gateway fleet: LLM + MCP gateway with guardrails (~5% fee).
  • Zuplo AI Gateway — Programmable policies: USD spend limits, prompt-injection detection, secret masking, MCP support.
  • NetFoundry MCP/LLM Gateways — Zero-trust gateways for AI deployments (launched June 2026).
  • AWS AgentCore Gateway — Tool/MCP gateway inside Bedrock AgentCore.
  • IBM ContextForge ⭐ 3.9k — MCP gateway/registry federating many MCP servers behind one endpoint with auth, rate limits and observability.
  • MetaMCP ⭐ 2.4k — Aggregates MCP servers into one endpoint with middleware (auth, filtering) and a management UI.
  • MCPJungle ⭐ 1.1k — Self-hosted MCP registry + gateway for central tool governance in enterprises.
  • Obot ⭐ 830 — Open-source agent platform with an MCP gateway for governing tool access.
  • Director ⭐ 479 — Middleware to run, secure and observe MCP servers behind one connection.
  • Lasso MCP Gateway ⭐ 376 — Security-first MCP gateway: plugin guardrails, secret masking, threat detection.
  • Pomerium ⭐ 4.9k — Identity-aware access proxy with MCP support: policy-based auth in front of MCP servers.

🔧 More by capability (cross-cutting)

These cut across the need-based sections above — routing intelligence, observability, and Kubernetes infra that complement whichever gateway you picked.

🧠 Smart routing & model selection

Pain point: "Send each prompt to the cheapest model that can handle it."

  • Not Diamond — SOTA model-routing intelligence; powers OpenRouter's Auto router.
  • Martian — Pioneer commercial model router; Accenture partnership.
  • Inworld Router — One API for 200+ models with real-time complexity-based routing and 0% markup (pass-through pricing); adds first-party realtime inference for open models. Research preview.
  • RouteLLM ⭐ 5k — LMSYS's open router framework (research-grade; inactive since 2024 but still the canonical paper/code).
  • OpenRouter Auto — One model id (openrouter/auto) that routes per-prompt.
  • Unify — Early neural LLM router (company since pivoted to agents).
  • Bifrost adaptive load balancing / Cloudflare dynamic routing — routing built into gateways themselves.
  • Claude Code Router ⭐ 35k — Route Claude Code (and other agent CLIs) to any model/provider — DeepSeek, Qwen, local — by request type.
  • vLLM Semantic Router ⭐ 4.4k — Mixture-of-models router that picks a model per prompt by intent/complexity; a vLLM project.
  • NVIDIA LLM Router ⭐ 294 — NIM-based blueprint routing each prompt to the best model by task and complexity.
  • LLMRouter ⭐ 2k — Research framework for graph/learned cost–quality model routing.
  • Orq.ai — Hosted routing control plane: 500+ models across 30+ providers with retries, fallbacks, caching and governance (BYOK).

📊 Observability & cost tracking

Pain point: "Who spent what, on which model, and why did quality drop?"

  • Helicone ⭐ 5.8k — Logs, costs, sessions, prompt experiments; one-line proxy integration.
  • TensorZero ⭐ 11.6k — ⚠️ Archived June 2026 (repo read-only; Apache-2.0 code + community forks remain). Gateway + observability + evals in one Rust binary, data stays in your ClickHouse.
  • Portkey — Full LLMOps suite over its OSS gateway: traces, budgets, prompt management.
  • vLLora (ex-LangDB) ⭐ 804 — Agent debugging and observability from the LangDB team.
  • Braintrust Proxy ⭐ 399 — Caching proxy wired into Braintrust evals.
  • MLflow AI Gateway ⭐ 26.5k — Unified endpoints + governance inside the MLflow platform.
  • Respan (ex–Keywords AI) — One endpoint to 250+ models with routing/fallback/caching, plus built-in observability and evals.

☸️ Kubernetes-native & inference infra

Pain point: "Routing to self-hosted models (vLLM/Ollama) inside the cluster, GPU-aware."

  • Gateway API Inference Extension ⭐ 693 — The Kubernetes standard for inference-aware routing.
  • AIBrix ⭐ 4.9k — Cost-efficient control plane for vLLM on K8s (ByteDance-origin).
  • llm-d ⭐ 3.4k — K8s-native distributed inference serving (Red Hat/Google/IBM-backed).
  • Higress ⭐ 8.7k / Kong ⭐ 43.6k / Envoy AI Gateway ⭐ 1.8k — all implement inference-extension-style routing.
  • Traefik Hub AI Gateway — LLM routing/security in Traefik's commercial runtime.
  • Inference Gateway ⭐ 125 — Small cloud-native gateway unifying cloud + local (Ollama) providers.
  • KServe ⭐ 5.6k — The standard model-inference platform on K8s; LLM serving with an inference-gateway / OpenAI-compatible runtime.
  • GPUStack ⭐ 5.2k — Manage GPU clusters and serve LLMs behind one OpenAI-compatible endpoint.
  • vLLM Production Stack ⭐ 2.4k — Reference K8s stack to serve vLLM at scale with a KV-cache-aware routing layer.

📰 What's new

Curated monthly. Last review: 2026-06-15.

  • 2026-06 · TensorZero shut down — the VC-backed open-source LLMOps gateway ($7.3M seed) archived its repo on June 12, as first-party clouds ship native gateway/observability features and squeeze independents. (byteiota)
  • 2026-03 · Helicone acquired by Mintlify (now maintenance mode); the same month LiteLLM hit a PyPI supply-chain attack — v1.82.7/1.82.8 were backdoored via a CI-token compromise and quarantined in ~3h, a sharp reminder to pin gateway versions. (Mintlify, Trend Micro)
  • 2026-05 · Palo Alto Networks completed its acquisition of Portkey (announced Apr 30, closed May 29), making the AI gateway the control plane for its Prisma AIRS security platform — a sign gateways are becoming core security infrastructure. (Palo Alto Networks)
  • 2026-05 · OpenRouter raised a $113M Series B led by CapitalG at a $1.3B valuation — ~8M users, ~100T tokens/month. (TechCrunch)
  • 2026-06 · NetFoundry launched zero-trust MCP and LLM gateways; Cisco Investments joined its Series A. (PR Newswire)
  • 2026 · Cloudflare AI Gateway shipped dollar-denominated spend limits (public beta) on top of dynamic routing and unified billing. (Cloudflare blog)
  • 2025-11 · Pydantic AI Gateway went open beta and has since merged into Logfire; F5 added data-leakage detection to its AI Gateway via the LeakSignal acquisition. (Pydantic Logfire, F5)
  • Trend · MCP gateways emerged as a distinct category; spend-limit enforcement became table stakes; the EU AI Act (enforceable Aug 2026) is driving the compliance bucket; new-api overtook one-api as the most active China-ecosystem relay; and an independent-gateway shakeout is underway — Portkey (→Palo Alto) and Helicone (→Mintlify) acquired, TensorZero shut down.

🚀 Recent releases (auto-updated)

Glossary

  • AI gateway / LLM gateway — a proxy between your app and LLM providers; one endpoint and key for many models.
  • LLM router — the part that decides which model serves each request (cheap vs flagship, by cost or quality).
  • Fallback — automatically retry on another model/provider when the first fails or times out.
  • Load balancing (LB) — spread traffic across keys/providers to dodge rate limits and outages.
  • Semantic caching — return a cached answer when a new prompt is semantically similar to a past one (not just identical).
  • Prompt / cached input — providers bill reused prompt prefixes at a steep discount (≈0.1×); the gateway must not mangle the prefix or the cache misses.
  • Guardrails — input/output checks: prompt-injection detection, PII redaction, content filtering, schema enforcement.
  • Virtual keys — per-user/team keys the gateway issues in front of your real provider keys, with their own budgets and limits.
  • ZDR (zero data retention) — provider/gateway contractually does not store your prompts or completions.
  • BYOK — bring your own key: the gateway uses your provider accounts rather than reselling tokens.
  • Markup — the gateway's fee on top of provider token cost (0% to ~6%).
  • MCP gateway — governs agent ↔ tool traffic (Model Context Protocol), the agentic counterpart to an LLM gateway.

How to choose safely

Start by matching the gateway's trust level to your data's sensitivity — this one call decides most of the rest:

Your dataRoute it toDon't
🔴 Secrets / regulated (PII, PHI, financial, source code, keys)First-party direct + ZDR (Azure / Bedrock / Vertex) or a gateway self-hosted in your VPC…send it through any third-party relay — full stop
🟡 Internal / businessCompliant hosted (Cloudflare, Vercel, Portkey) or self-hosted (LiteLLM, Bifrost)…use an unvetted relay; get ZDR in writing
🟢 Low-stakes / public / throwaway (demos, scraped public text)Cheapest wins — a gray relay can even be economically rational here…skip the canary test: assume model-swap + data-harvest until you've proven otherwise

The mistake is using one trust tier for all your traffic. Sensitive prompts through a $0.50/M relay is how keys leak; throwaway prompts through a FedRAMP endpoint is how you overpay 100×. Match the tier to the data.

Then, whatever tier you're in:

  1. Check the markup. Marketplaces charge 0–6% — for high volume, self-hosting or 0%-markup gateways (Vercel, Helicone cloud) pay for themselves fast.
  2. Verify model fidelity (canary-diff test). Some relays silently downgrade or quantize models. Send fixed "canary" prompts — a known-hard reasoning question plus a tokenizer/fingerprint probe — through the gateway and direct to the provider, then diff the outputs — scripts/canary_check.py automates exactly this (relay vs. official → a verdict you can attach to a watch-list report). 2026 research found model-identity failures in ~46% of audited relays (arXiv:2603.01919). Community monitors apiranking.com and rate.linux.do (browser-only) track relay authenticity/stability — usable as signal if you must vet one, but listing there is not endorsement, and this list includes none of them.
  3. Mind data flow. Every gateway sees your prompts. For sensitive data: self-host, or require ZDR (zero data retention) in writing.
  4. License check before embedding. new-api is AGPL-3.0; LiteLLM has an enterprise-licensed directory; "open core" ≠ everything free.
  5. Project health. Star count ≠ maintenance. Check last release date — several once-popular gateways (BricksLLM, Glide, RouteLLM) are effectively unmaintained; this list labels them.
  6. Avoid gray-market relays reselling reverse-engineered or stolen-quota access. Beyond account-ban risk, 2026 research caught relays serving poisoned models and exfiltrating planted secrets (Your Agent Is Mine) — and the most-visible relay "rankings" are often paid press releases or carry affiliate links. Account bans and data leaks are your risk, not theirs. Caught one swapping models, harvesting data, or vanishing with your balance? Report it — with evidence — and we'll build the community watch list together.

FAQ

What is an AI gateway (LLM gateway)? A proxy between your code and LLM providers: one OpenAI-compatible endpoint and key for many models, adding routing, failover, caching, rate limits, cost tracking and guardrails. See the intro.

AI gateway vs LLM router — what's the difference? A router decides which model gets each request (e.g. cheap vs flagship); a gateway is the full proxy layer (auth, caching, observability, guardrails) that usually includes routing. See smart routing.

What's the best open-source AI gateway? LiteLLM is the default for breadth (Python, 100+ providers). For raw performance pick Bifrost (Go); for enterprise K8s pick Kong or Higress. Full list under self-hosted.

LiteLLM vs OpenRouter — which should I use? OpenRouter is hosted (zero ops, ~5.5% fee, 400+ models); LiteLLM is self-hosted (your keys, your infra, $0 markup). Hosted to start, self-host when volume justifies it. Cost math in the evaluation set.

What's the cheapest way to call many LLMs? For zero ops: Vercel AI Gateway or Cloudflare AI Gateway (0% markup). For lowest token cost, route bulk work to cheap models — a 100K-token report runs $0.03 on DeepSeek vs $3.01 on GPT-5.5. See cost-first.

Are AI gateways safe? Who sees my prompts? Every gateway sees your prompts. For sensitive data self-host or require zero-data-retention in writing; check the gateway scorecard for compliance/security ratings and known CVEs.

📚 Essential reading

A short, vetted shelf — every link below was HTTP-checked live (2026-06-15). These are the concepts the comparison tables assume; read them before you commit to a gateway.

What an AI gateway actually is

Routing & fallback

Semantic caching

Prompt caching (it's a prefix match)

  • Prompt caching — Anthropic — the authoritative spec: cache key from exact bytes up to a breakpoint, write/read pricing, and TTLs.
  • Prompt caching — OpenAI — cache hits require an exact prefix; put static instructions first and variable content last to maximize reuse.

Reasoning-token cost

  • Building with extended thinking — Anthropic — reasoning/thinking tokens are billed and consume the output budget — the economics to grasp before enabling reasoning models behind a gateway.

Security & guardrails

MCP & agent gateways

  • Model Context Protocol — specification — the open standard any MCP gateway must speak and govern.
  • Building effective agents — Anthropic, 2024 — when to use workflows vs. agents and the composable patterns (routing, orchestrator-workers) the traffic flowing through an agent gateway is made of.
  • LLM Powered Autonomous Agents — Lilian Weng, 2023 — the canonical map of agent architecture (planning, memory, tool use) — what an MCP/agent gateway sits in front of and governs.

Observability

  • AI Gateway observability — Cloudflare — per-request logs, token usage, cost estimation and OpenTelemetry export across all providers.
  • How to monitor your LLM API costs — Helicone — practical cost-per-query tracking and spotting caching / model-downgrade opportunities.
  • Your AI Product Needs Evals — Hamel Husain, 2024 — why systematic evals (not vibes) are how you actually catch quality regressions in the request/response data your gateway logs.

Self-hosting economics

  • Automatic prefix caching — vLLM — KV-block prefix caching (and per-request cache isolation), the mechanism behind the savings when you self-host behind your own gateway.

Guides & comparisons

In-depth, data-backed comparisons for the questions people actually search:

More comparisons coming. Suggest one via an issue.

Why this exists

On June 10 I ran Claude Code hard for ~13 hours, and the bill came to ≈ $788. One look at the per-model breakdown told the whole story: the flagship (Fable 5) alone was $617 — 78% of the bill — while the cheap model (Haiku) did 242 real tasks for $1.70. I hadn't done anything clever to rack that up; I'd done the opposite — defaulted every request to the most capable (and most expensive) model because I couldn't be bothered to set up routing.

The fix wasn't "stop using good models." It was route by task — default to a cheap model, escalate to a flagship only when the work is genuinely hard. That's exactly what an AI gateway is for. While I was at it, I couldn't find a single gateway list organized by what you actually need, that scored the options honestly (CVEs and all), and shipped reproducible cost numbers instead of vibes. So I built one — that's this repo.

No vendor money, no affiliate links, CC0. If it saves you one surprise bill, it did its job. ⭐ Star it so the next person mid-$788-day finds it.

Contributing

Contributions welcome! Please read CONTRIBUTING.md first. Inclusion criteria, in short: the project must be an actual gateway/proxy/router for LLM or agent traffic (not an SDK wrapper or chat UI), publicly available, and active within the last 12 months — or clearly labeled as stale.

Star history

Star History Chart

License

CC0

To the extent possible under law, the contributors have waived all copyright and related rights to this work.

Ver o original no GitHub

Bom para

Relacionados