Hosted
r.wyolet.com
Sign in, add a provider key, mint a relay key. Multi-user workspaces, usage and cost dashboards, nothing to operate.
- console
- r.wyolet.com
- inference
- api.r.wyolet.com
Open-source LLM gatewayApache-2.0single binary
Relay takes OpenAI- and Anthropic-shaped requests, checks them against a policy, draws a healthy key from your pool and streams the answer back. Failover, rate limits and per-request metering move out of your app and into the gateway.
docker run -p 8080:8080 -p 8081:8081 wyolet/relay:standaloneRouting simulation
#0001 claude-code
200
POST /claude-code/v1/messages model=claude-sonnet-4-6
01Drop-in
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.r.wyolet.com/openai/v1",
api_key=os.environ["RELAY_API_KEY"],
)
# a Claude model through the OpenAI SDK; Relay translates both ways
resp = client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "hello"}],
stream=True,
)02Request path
01 · auth
The relay key is hashed and looked up in an in-memory snapshot. No match, 401.
sha256 · no DB read
02 · route
The key's policy must grant the model. The model resolves to a host binding: wire adapter plus upstream model name.
403 if not granted
03 · draw
Rate-limit budget is reserved and a healthy host key drawn from the pool. Open breakers are skipped; failover happens here.
one Redis Lua call
04 · stream
Same shape in and out: bytes pass through. Different shapes: each chunk is translated through Relay's canonical protocol.
passthrough | translate
05 · settle
After the response ends, a detached goroutine commits usage, records key health and emits the usage event.
off the response path
No mid-stream failover
Every retry across keys and hosts happens before the first byte reaches the caller. Once bytes flow the request is committed, and an upstream error is surfaced as-is, with its original status and Retry-After.
03Spec sheet
Upstreams
OpenAI · Anthropic · Google AI Studio · AWS Bedrock · Vertex AI · Azure OpenAI · Groq · Mistral · xAI · Ollama · OpenRouter · anything speaking either wire format. Open catalog
04Clients
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.r.wyolet.com/claude-code",
"ANTHROPIC_AUTH_TOKEN": "sk-wr-your-relay-key",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
"CLAUDE_CODE_GATEWAY_HINT_HEADERS": "1"
}
}| Claude Code | /claude-code | messages, model discovery, startup probe |
|---|---|---|
| Codex CLI | /codex/v1 | responses, picker catalog |
| OpenCode | /opencode/v1 | chat completions or messages, api.json |
| OpenAI SDK | /openai/v1 | chat completions |
| Anthropic SDK | /anthropic | messages |
Claude Code can also run in proxy mode: it keeps its own Claude login and Relay only observes. Setup guide
05Deploy
Hosted
Sign in, add a provider key, mint a relay key. Multi-user workspaces, usage and cost dashboards, nothing to operate.
Self-hosted
The standalone image bundles the API, admin UI, database and a seeded model catalog. The chart runs its own Postgres, ClickHouse and Valkey. Nothing phones home.
docker run -p 8080:8080 -p 8081:8081 wyolet/relay:standalone:8080 inference · OpenAI + Anthropic shapes
:8081 admin UI + control API, setup wizard
06FAQ
Stored keys are AES-GCM encrypted with RELAY_MASTER_KEY before they reach Postgres. Self-hosted, you can instead reference an environment variable or fetch from AWS, Azure or GCP Secret Manager, Bitwarden or 1Password, in which case the secret is held in memory only.
The key's breaker records the failure class (auth, short or long rate limit, 5xx, network) and opens. Relay draws the next healthy key in the pool before any byte reaches you. Open breakers heal after their cooldown; a rotated key gets a fresh breaker automatically.
Routing reads an in-memory snapshot, rate limits cost one Redis round-trip, and bytes are copied rather than re-serialised when shapes match. Added latency stays in single-digit milliseconds at p50 under real load; scale out by adding pods.
Yes. The model string selects the host; if the host speaks a different wire format, Relay translates the request and every streamed chunk. Anthropic-only features such as cache_control are not carried across shapes.
Same code. r.wyolet.com is our deployment of it with multi-user workspaces. Self-host when you want the data on your own infrastructure.