MITFree & open source self-hosted

One endpoint for every LLM provider.

Aether is a self-hosted gateway that speaks the OpenAI API. Point the SDK you already use at it and get automatic failover, caching, per-key quotas and the cost of every call – without touching your application code.

docker compose up -dJava 25 · Spring Boot 4.1 · Docker Compose & Kubernetes

Live request flowSimulated in your browser
Your appPOST /v1/chat/completions“What is 2+2?”
Aether Gateway:8080/v1
  1. 1AuthAPI key → limits
  2. 2Quotatoken bucket
  3. 3Cacheexact match
  4. 4Routerchain + breakers

then streams the reply and records tokens, cost and metrics off the hot path

  • Ollamalocal
  • Groqcloud
  • Geminicloud
  • Anthropiccloud
  • OpenAIcloud
Response200 OK
HTTP/1.1 200 OK
X-Aether-Provider: groq
X-Aether-Cache: MISS
X-Aether-Cost-USD: 0.0000195
X-Aether-Attempts: 1

One OpenAI-compatible API in front of

  • Ollama
  • Groq
  • Google Gemini
  • Anthropic
  • OpenAI
  • vLLMOpenAI-compatible
  • Hugging Face TGIOpenAI-compatible
  • Any OpenAI-compatible API

Product names and logos are trademarks of their respective owners. Aether is not affiliated with them.

Benchmarks

Measured, not estimated.

Every number comes from a committed run against the real stack. The harness, raw CSVs and methodology are in the repository – reproduce them with make bench.

Cache-hit latency
8.9ms
p95, end to end, confirmed EXACT_HIT
Failover to a healthy provider
67.92ms
p99 across 100 injected outages
Streams survived a rolling update
500/500
Kubernetes, run twice, zero broken
Prompt embedding for semantic cache
7.23ms
mean, all-MiniLM-L6-v2

Watch the demo

70 seconds, real requests.

Recorded against a running gateway: a real Claude call with its cost header, the same request served from cache for $0, failover when a provider goes down, streaming, tool calling, Grafana and the console.

See it work

Break things. Watch Aether handle it.

Four interactive walkthroughs of what the gateway does on every request. They run in your browser and mirror the real behaviour and headers; only numbers marked measured come from benchmarks.

Failover playground

Simulated in your browser

Click a provider to take it down, then send a request. Aether walks the chain for model: "chat" in order; a failing provider trips its circuit breaker, and later requests skip it until it recovers.

Your app POST /v1/chat/completions

Press a provider to toggle it between healthy and down.

Response200 OK
X-Aether-Provider: openaiX-Aether-Attempts: 1X-Aether-Cache: MISS
  1. Send a request to see the trace.
Measured

67.92 ms p99 to fail over to a healthy provider, across 100 independent injected outages. Benchmark report

Ask the same thing twice

Simulated in your browser

The first request goes to a provider and is billed. An identical repeat is answered from the exact-match cache with X-Aether-Cost-USD: 0 – no provider call at all.

Your app
CacheRedis · per key
Providerbilled per token
Send a prompt to compare latency.
Responsewaiting
Send a prompt to see the headers.
Requests
0
Cache hits
0
Provider calls avoided
0
Spend avoided
$0.0000000
Measured

8.9 ms p95 end-to-end latency for a cache hit, over 100 requests confirmed as EXACT_HIT.

Close the tab mid-answer

Simulated in your browser

Tokens are relayed as server-sent events the moment the provider produces them. If the user leaves, Aether cancels the upstream request, so the rest of the answer is never generated or billed.

Explain circuit breakers in one paragraph.

A circuit breaker watches calls to a dependency. While calls succeed it stays closed and lets traffic through. When failures pass a threshold it opens, and calls fail fast instead of waiting on a dependency that is already down. After a cool-down it lets a few trial calls through; if they succeed it closes again, and if not it stays open. That protects your users from slow timeouts and gives the struggling service room to recover.

Upstream · SSEidle
data: {"choices":[{"delta":{"content":"A"}}]}data: {"choices":[{"delta":{"content":" circuit"}}]}data: {"choices":[{"delta":{"content":" breaker"}}]}
Tokens generated
0 / 76
Billed so far (simulated)
$0.000000

Start the stream, then close the tab before it finishes.

Drain the token bucket

Simulated in your browser

Every API key has its own rate limit and monthly token budget. Tokens are reserved before the provider call and reconciled to the real count afterwards. Empty the bucket and the next request gets a 429 withRetry-After – then watch it refill.

Rate limit · key team-a8 / 8 tokens · refills 1 per second
Monthly budget20,000 of 20,000 tokens left
Last responsewaiting
Send a request to see the headers.
  1. No requests yet.
Measured

0 over-issue with 100 concurrent requests against a 50-token budget: exactly 50 allowed, 50 rejected.

Drop-in

Change two lines. Keep your SDK.

Aether speaks the OpenAI API – chat completions, streaming, tool calling and embeddings – so the client you already use keeps working. Swap the base URL and key, and every response starts telling you what it cost.

2 lines changed
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8080/v1",
    api_key="your-aether-key",
)

reply = client.chat.completions.create(
    model="mock",
    messages=[{"role": "user", "content": "What is 2+2?"}],
)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "http://localhost:8080/v1",
  apiKey: process.env.AETHER_API_KEY,
});

const reply = await client.chat.completions.create({
  model: "mock",
  messages: [{ role: "user", content: "What is 2+2?" }],
});
curl http://localhost:8080/v1/chat/completions \
  -H "Authorization: Bearer $AETHER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"mock","messages":[
        {"role":"user","content":"What is 2+2?"}]}'
~/aether-gateway
docker compose up -d✔ Container aether-gateway-postgres-1 Started✔ Container aether-gateway-redis-1 Started✔ Container aether-gateway-mock-primary-1 Started✔ Container aether-gateway-mock-fallback-1 Started✔ Container aether-gateway-gateway-1 Started✔ Container aether-gateway-prometheus-1 Started✔ Container aether-gateway-grafana-1 Startedcurl -sS -D - localhost:8080/v1/chat/completions -d '{"model":"mock","messages":[{"role":"user","content":"What is 2+2?"}]}'HTTP/1.1 200 OKX-Aether-Cache: MISSX-Aether-Cost-USD: 0.0000195X-Aether-Attempts: 1X-Aether-Provider: mock-primary

Features

Everything around the model call.

Calling a model is one line. Keeping it fast, affordable and up when a provider is not is the hard part – that is what Aether does.

  • Automatic failover

    Circuit breakers, retries and bulkheads move traffic to the next provider in the chain, so a provider outage never becomes your outage.

  • Response caching

    Identical requests are answered from cache for $0. Semantic matching for near-duplicate prompts is opt-in per route, with an entity and number guard.

  • Quotas per API key

    Rate limits, concurrency caps and monthly token budgets, reserved atomically in Redis before the call and reconciled to the real count after.

  • Cost on every response

    X-Aether-Cost-USD, X-Aether-Provider and X-Aether-Cache tell you what a call cost, who served it and whether it hit cache.

  • Streaming that stops when users leave

    SSE relayed token by token. A client disconnect cancels the upstream call, so you stop paying for tokens nobody will read.

  • Tool calling and embeddings

    OpenAI-format tools and tool_calls pass through, streaming included, and /v1/embeddings gets the same auth, failover and cost headers.

  • Observability and console

    Prometheus metrics and a ready-made Grafana dashboard, plus an operator console for API keys, versioned prompts, cache stats and the request log.

  • Kubernetes-ready

    Plain manifests with graceful SSE drain, a PodDisruptionBudget and a NetworkPolicy, proven against real zero-downtime rolling updates.

How it works

One request, six steps, one response.

Every request runs through the same pipeline, and the response headers tell you what happened. On a cache hit, routing and streaming are skipped entirely – X-Aether-Cache: EXACT_HIT,X-Aether-Cost-USD: 0.

  1. Authenticate

    API key resolves to its own limits and budget.

    Postgres
  2. Enforce quota

    Token bucket and budget reserved atomically.

    Redis
  3. Check cache

    Exact match, plus semantic nearest neighbour where a route opts in.

    pgvector
  4. Route & fail over

    Policy picks a provider chain; breakers skip the unhealthy.

    routing.yaml
  5. Stream

    SSE relayed as it arrives; disconnect cancels upstream.

    WebFlux
  6. Account

    Tokens, cost, cache write and metrics, off the hot path.

    Prometheus

Compare

Where Aether fits.

There are good LLM gateways already. Here is an honest look at how Aether differs, so you can pick the right one.

Aether GatewayLiteLLMPortkey GatewayBuild your own
RuntimeJava 25 · Spring Boot 4.1 (JVM)PythonTypeScriptYour stack
LicenseMIT, no paid editionMIT core, enterprise features licensed separatelyMIT gateway, managed platform availableYours
Self-hostingOne docker compose stack: gateway, Postgres + pgvector, Redis, Prometheus, GrafanaSupportedSupportedYou design, build and operate it

Aether is a good fit if you…

  • run on the JVM, or want a gateway your Java team can read and extend
  • want one self-hosted stack with caching, quotas, metrics and dashboards included
  • want performance numbers you can reproduce yourself, not just read
  • need a plain MIT license with no paid edition

Look elsewhere if you…

  • need the widest provider catalogue today – LiteLLM and Portkey support many more
  • want a fully managed, hosted service instead of running your own
  • want an in-process Python library rather than a network gateway

Details about other projects are summarised from their public repositories and may change; check their documentation for current status.

Your first request is a minute away.

One command brings up the gateway, Postgres + pgvector, Redis, two mock providers for failover demos, Prometheus and Grafana – seeded and ready.

$ git clone https://github.com/Ashish-CodeJourney/aether-gateway.git
$ cd aether-gateway
$ docker compose up -d
# gateway on :8080 · Grafana on :3000