| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
One OpenAI-compatible API in front of every model. Route, govern, secure, cache, and observe all your LLM and AI-agent traffic from a single control point — shipped as one static binary with low per-request overhead. Run it in your infrastructure for free, forever.
Built by the original creators of Apache APISIX.
Start free · Documentation · Quickstart · AISIX Cloud · Roadmap
AISIX AI Gateway is a Rust-native gateway that puts a single, OpenAI-compatible API in front of every LLM provider — OpenAI, Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI, DeepSeek, and any OpenAI-compatible endpoint. It gives platform teams one place to route, govern, secure, and observe LLM traffic, with first-class SSE streaming and low gateway overhead.
It runs as a single static binary — low cold-start, lock-free config reads, and hot configuration reloads with no restarts: declare resources in one resources.yaml and reload on SIGHUP, or point the gateway at etcd for a multi-replica cluster. Run the open-source gateway in your infrastructure, or connect it to AISIX Cloud for centralized management with team governance, budgets, audit, and a dashboard.
AISIX AI Gateway (this repo) is the open-source product. It runs without a control plane using declarative configuration or etcd. When connected to AISIX Cloud, the same gateway serves as the data plane. AISIX Cloud adds a commercial control plane, either hosted by API7 (Hybrid Cloud) or hosted by you in your infrastructure (On-Premises). In both options, the gateway runs in your environment and calls providers directly; live AI traffic does not pass through the control plane or API7. The proxy API is identical throughout. Talk to us about AISIX Cloud →
One container. No control plane, no database, no configuration store — the gateway reads every dynamic resource from one declarative resources.yaml.
# config.yaml
resources_file: /etc/aisix/resources.yaml
proxy:
addr: "0.0.0.0:3000"
admin:
enabled: false # a declarative gateway needs no admin listener
observability:
metrics:
prometheus:
enabled: true
addr: "0.0.0.0:9090"# resources.yaml
_format_version: "1"
provider_keys:
- display_name: openai-main
provider: openai
api_key: ${OPENAI_API_KEY} # interpolated from the environment
models:
- display_name: my-model
provider: openai
model_name: gpt-4o-mini
provider_key: openai-main
api_keys:
- display_name: local-dev
key_env: CALLER_API_KEY # hashed at load; the plaintext is never stored
allowed_models: ["my-model"]export OPENAI_API_KEY="YOUR_PROVIDER_KEY"
export CALLER_API_KEY="YOUR_CALLER_KEY"
docker run -d --name aisix \
--platform linux/amd64 \
-v "$(pwd)/config.yaml:/etc/aisix/config.yaml:ro" \
-v "$(pwd)/resources.yaml:/etc/aisix/resources.yaml:ro" \
-e OPENAI_API_KEY -e CALLER_API_KEY \
-p 3000:3000 -p 127.0.0.1:9090:9090 \
ghcr.io/api7/aisix:latest # proxy → :3000, metrics + status → :9090
# ^ the metrics/status listener is unauthenticated;
# keep it on loopback or a private networkThen call the gateway exactly like OpenAI:
curl http://localhost:3000/v1/chat/completions \
-H "Authorization: Bearer $CALLER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"my-model","messages":[{"role":"user","content":"hello"}]}'Edit resources.yaml and send SIGHUP (docker kill -s HUP aisix) to apply changes with no restart — an invalid file is rejected whole and the last good configuration keeps serving. Check a file before booting with aisix validate --resources resources.yaml.
Full walkthrough: the Gateway Quickstart · every field: the resources file reference. For a multi-replica cluster, point the gateway at etcd instead — resources_file and etcd are mutually exclusive.
Covered by 183 end-to-end scenario files (496 cases) that run against real gateway processes.
AISIX dispatches through five native adapter families — distinct wire-protocol bridges, not one generic relabel. Whatever the upstream protocol, the client-facing API stays OpenAI-shaped.
| Adapter family | Reaches | Wire shape · auth |
|---|---|---|
| openai | OpenAI + any OpenAI-compatible vendor — DeepSeek, Groq, Mistral, Together, Fireworks, Perplexity, vLLM, Ollama, or self-hosted OpenAI-compatible endpoints | OpenAI chat completions · Bearer |
| anthropic | Anthropic Claude | Anthropic Messages · x-api-key |
| bedrock | AWS Bedrock — Anthropic, Meta Llama, Mistral, Cohere, Amazon Titan/Nova, AI21 | Bedrock Converse + /invoke · SigV4 |
| vertex | Google Vertex AI (Gemini) | Vertex :generateContent · OAuth2 |
| azure-openai | Azure OpenAI | Azure deployments · api-key / Entra ID |
Plus specialized handling for vendor quirks (e.g. DeepSeek reasoning content) and dedicated rerank / embeddings vendors (Cohere, Jina). Details in adapter protocol families.
Same gateway binary, same proxy API — in every form the gateway runs in your environment. AISIX Cloud adds a commercial control plane, either hosted by API7 (Hybrid Cloud) or hosted in your infrastructure (On-Premises).
The AISIX Cloud dashboard — overview metrics, multi-provider models, guardrails, budgets (with hard-stop spend caps), and observability exporters, across all your gateways.
▶ Try the live dashboard demo — aisix-demo.api7.ai
| Open-source gateway (this repo) | AISIX Cloud (Hybrid Cloud or On-Premises) | |
|---|---|---|
| Price | Free · Apache-2.0 · forever | Commercial — talk to us |
| Configuration | Declarative resources.yaml, or etcd for a cluster | Dashboard + Cloud Admin API, multi-environment |
| Tenancy | Single instance / namespace | Org → Team → Member → Environment |
| Provider keys | In the resources file as ${VAR} env references, or in etcd | Envelope-encrypted at rest, write-only, in-place rotation |
| Inbound auth | Caller keys (SHA-256 hashed, model allowlists, expiry), or OIDC/JWT bearers | Same, plus masked reveal, key ownership, and PATs |
| Budgets | — (rate and token limits only) | Per key / provider / env / org / team, hard-stop & alerts |
| RBAC | Admin key = read-only resource surface | Org roles (owner / admin / member), invites |
| Audit log | — | Full org-scoped audit with diff viewer |
| Usage & cost | Export logs, metrics, and usage events yourself | Managed usage views, model pricing catalog, spend reporting |
| Surface | Status endpoints, OpenAPI read surface, playground | Full dashboard + per-environment playground |
→ Want the AISIX Cloud control plane, governance, budgets, and dashboard? Talk to API7 about Hybrid Cloud or On-Premises, or book a demo.
A single Cargo workspace; the aisix-server crate builds one binary named aisix that wires the crates together.
crates/
├── aisix-core Config, snapshot, resource model, resources.yaml source, errors
├── aisix-etcd Config provider + watch supervisor
├── aisix-gateway Hub & bridge, SSE parser, provider trait
├── aisix-proxy /v1/*, /mcp, /a2a handlers, routing, middleware
├── aisix-admin Read-only resource surface + playground + OpenAPI
├── aisix-provider-* openai · anthropic · azure-openai · bedrock · vertex
├── aisix-mcp MCP gateway — server registry, tool ACL, transports
├── aisix-a2a A2A agent gateway — agent cards, JSON-RPC bridge
├── aisix-ratelimit fixed-window + token accounting + concurrency (local | redis)
├── aisix-cache memory + redis backends
├── aisix-redis shared Redis connection for cache + rate limits
├── aisix-guardrails pre/post content-policy hooks
├── aisix-obs tracing, metrics, access log, exporters
└── aisix-server the `aisix` binary — bootstrap + CLI
Highlights on the roadmap; tracked live in issues:
Shipped since this list was last written: the MCP gateway, the A2A agent gateway, OIDC/JWT inbound auth, Redis-backed distributed rate limiting, and the Lakera, Presidio, PII, and OpenAI Moderation guardrails — see Features above.
Prerequisites: the Rust toolchain pinned in rust-toolchain.toml. Docker is only needed for the tests that exercise etcd, Redis, or provider emulators.
cargo check --workspace
cargo fmt --check
cargo clippy --workspace -- -D warnings
cargo test --workspace
# Coverage (matches the CI gate)
cargo llvm-cov --workspace --lcov --output-path lcov.info
# Run locally against a resources.yaml (no etcd needed). Copy the Quickstart's two files
# and change resources_file to the local path, e.g. resources_file: ./resources.yaml
cargo run -p aisix-server --bin aisix -- --config config.local.yaml
# Check a resources file without starting a listener
cargo run -p aisix-server --bin aisix -- validate --resources resources.yamlIf AISIX is useful to you, a ⭐ helps other engineers find it.
| Back | FazBrowse Home | New Git URL |