AI/TLDR

Apache APISIX

Cloud-native API gateway with AI plugins for proxying and governing LLM traffic

Gateways & RoutingOpen source
Language
Lua
License
Apache-2.0
$curl -sL https://run.api7.ai/apisix/quickstart | sh

Overview

Apache APISIX is a dynamic, real-time API gateway that handles traffic management tasks such as load balancing, dynamic upstreams, canary releases, circuit breaking, authentication, and observability. It runs anywhere from bare-metal to Kubernetes and can also act as a Kubernetes ingress controller.

Through its plugin system, APISIX works as an AI gateway: it proxies requests to LLM providers, load balances across them, applies retries and fallbacks, and enforces token-based rate limiting and security controls. An mcp-bridge plugin can also expose stdio-based MCP servers as HTTP SSE services.

It fits the LLM gateway / proxy category for teams that already need a general-purpose gateway and want one place to route both traditional API traffic and AI model traffic, without locking into a single vendor.

What it does

  • AI proxying and load balancing across LLM upstreams, with retries and fallbacks
  • Token-based rate limiting plus authentication and security plugins for AI traffic
  • `mcp-bridge` plugin converts stdio-based MCP servers into scalable HTTP SSE services
  • Hot updates of configuration and plugins without restarts
  • Multi-protocol support: HTTP(S), gRPC, TCP/UDP, MQTT, Dubbo, WebSocket, and HTTP/3 with QUIC
  • Fine-grained routing with full-path and prefix matching, plus health checks and circuit breaking

Getting started

Run APISIX locally with the official quickstart script, then create and test a route through the Admin API.

Start APISIX

The quickstart script starts two Docker containers, apisix-quickstart and etcd. Docker is required.

bashbash
curl -sL https://run.api7.ai/apisix/quickstart | sh

Verify it is running

Check that APISIX answers on its proxy port 9080.

bashbash
curl "http://127.0.0.1:9080" --head | grep Server

Create a route

Use the Admin API on port 9180 to forward /ip to an upstream.

bashbash
curl -i "http://127.0.0.1:9180/apisix/admin/routes" -X PUT -d '{
  "id": "getting-started-ip",
  "uri": "/ip",
  "upstream": {
    "type": "roundrobin",
    "nodes": { "httpbin.org:80": 1 }
  }
}'

Test the route

Send a request through the gateway on port 9080 to confirm the route works.

bashbash
curl "http://127.0.0.1:9080/ip"

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Put a single gateway in front of multiple LLM providers, with load balancing, retries, and fallbacks between them
  • Enforce token-based rate limits, authentication, and access control on AI model traffic
  • Expose stdio-based MCP servers as HTTP SSE services using the mcp-bridge plugin
  • Run one gateway for both traditional north-south API traffic and AI traffic, including as a Kubernetes ingress controller

How Apache APISIX compares

Apache APISIX alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
OmniRoute★ 67.7kA local-first AI gateway that fronts hundreds of model providers with one OpenAI-compatible endpoint, quota-aware auto-fallback, many routing strategies and prompt compression.
LiteLLM★ 59.1kA Python SDK and proxy server that gives one OpenAI-compatible API to 100+ LLM providers, with cost tracking, budgets, fallbacks, rate limiting, and an admin UI.
Free Claude Code★ 55.4kA local proxy that points Claude Code, Codex, Pi, OpenCode, Cline and other agent CLIs at 50 free, paid, subscription or local model providers, with automatic failover and an admin UI.
Kong Gateway★ 44.1kA Lua/NGINX API gateway whose AI Gateway plugins put one universal endpoint in front of OpenAI, Anthropic, Gemini, Bedrock and other providers, with semantic routing, caching and MCP traffic governance.
9Router★ 29.2kLocal OpenAI-compatible router for coding CLIs that tracks per-provider quota, falls back from subscription to cheap to free models, and compresses tool results to cut tokens.
Apache APISIX★ 17.1kCloud-native API gateway with AI plugins for proxying and governing LLM traffic
OpenCodex★ 15.3kLocal proxy that translates the Codex Responses API to 40+ providers, so Codex CLI, Claude Code and Grok Build can run on any model, with routing combos, failover and account pooling.
Portkey AI Gateway★ 13kAn LLM gateway that routes calls to 100+ providers through one API and adds logging, tracing, caching, and fallbacks for production AI traffic.