RepositoryRust
nyroway

nyroway/nyro

Self-hosted AI Gateway — connect Claude Code, Codex, Gemini CLI and any SDK to any model provider with protocol translation.

200stars
34forks
32issues
6views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: openai-proxy

#1 Repository of the month

1
TINIX TRENDING·Topic: gemini-proxy

#1 Repository of the week

1
TINIX TRENDING·Topic: gemini-proxy

#1 Repository of the month

Nyro AI Gateway

Run your AI coding tools on any model, from any provider.
One gateway. All protocols. No code changes.

Release License 中文



What is Nyro?

Nyro is a local AI gateway that sits between your AI tools and model providers. It translates protocol formats on the fly — so Claude Code, Codex CLI, Gemini CLI, OpenCode, and any client using OpenAI / Anthropic / Gemini SDKs can all route through any backend model you choose, without changing a single line of code.

Point your clients at http://localhost:19530. Nyro handles the rest.

Claude Code · Codex CLI · Gemini CLI · OpenCode
     OpenAI SDK · Anthropic SDK · Gemini SDK
              Any HTTP API Client
                      ↓
              Nyro AI Gateway
            (localhost:19530)
                      ↓
    OpenAI · Anthropic · Google · DeepSeek
    MiniMax · xAI · Zhipu · Ollama · ...

Nyro ships as a desktop app (macOS / Windows / Linux) and a standalone server binary for headless and self-hosted deployments.


Why Nyro?

Use any model with any tool. Claude Code expects Anthropic protocol. Codex CLI uses OpenAI Responses API. Gemini CLI speaks Gemini. Nyro translates between all three so one model can serve all your tools simultaneously.

Switch providers without touching your tools. Change the target model or provider from Nyro's UI. Your tools never need reconfiguring.

Keep everything local. API keys are stored locally. Requests stay on your machine. No cloud relay, no shared infrastructure.

One UI for everything. Manage providers, routes, API keys, logs, and usage stats from a single interface — desktop app or browser.


Screenshots


Provider Management

Route Configuration

API Key Management

Connect — Code & CLI Integration

Features

Protocol Translation

  • Ingress: OpenAI (Chat Completions + Responses API), Anthropic Messages, Gemini GenerateContent
  • Egress: route to any OpenAI-compatible, Anthropic, or Gemini upstream
  • Streaming: full SSE passthrough and cross-protocol format conversion
  • Reasoning: <think> tag parsing and conversion across protocol boundaries
  • Tool calls: cross-protocol tool call and result format normalization
  • Route types: chat and embedding routes with type-aware handling

Routing

  • Exact match routing on virtual_model
  • Virtual model names decouple client requests from actual backend models
  • Multi-target routing with strategy selection: weighted load balancing or priority-based failover
  • Health-aware failover: 3 consecutive failures mark a target unhealthy, auto-recovery after 30s
  • Per-route access control with API key authorization

Caching

  • Exact cache: identical requests return cached responses instantly
  • Semantic cache: embedding-based similarity matching reuses results for similar queries
  • Per-route TTL and threshold overrides
  • Stream replay for cached streaming responses

Model Capabilities

  • Auto-detect model capabilities (tool call, reasoning, context window, modalities, costs)
  • ai://models.dev built-in data source for offline capability lookup
  • HTTP model list endpoints for dynamic model discovery
  • Capability tags shown in route configuration UI

Security

  • Independent proxy and admin bearer token controls
  • Default-deny route authorization — keys must be explicitly bound to routes
  • Per-key quotas: RPM / RPD / TPM / TPD

Management

  • Full CRUD for providers, routes, and API keys
  • Request logs with provider, model, token, and latency detail
  • Usage charts by model and provider
  • Provider connectivity testing with live feedback
  • Configuration import / export

Connect — Integration

Code Integration — select a route and copy ready-to-use examples for:

ProtocolLanguages
OpenAIPython · TypeScript · cURL
AnthropicPython · TypeScript · cURL
GeminiPython · TypeScript · cURL

CLI Integration — one-click config sync for AI coding tools:

ToolProtocol
Claude CodeAnthropic
Codex CLIOpenAI Responses API
Gemini CLIGemini
OpenCodeOpenAI

Nyro detects installed tools, generates the correct configuration for the selected route, and writes it with one click. Original configs are backed up automatically.

Deployment

Desktop App

PlatformArchitecture
macOSApple Silicon (aarch64) · Intel (x64)
Windowsx64 · ARM64
Linuxx86_64 · aarch64

Server Binary — three run modes for everything from single-host to distributed deployments

ModeFlagPurpose
all (default)--mode allProxy + Admin API + embedded WebUI in a single process
proxy--mode proxyData-plane only — no Admin API, no WebUI
admin--mode adminControl-plane only — Admin API (+ optional WebUI), no proxy
Standalone--config config.yamlYAML config, no DB, no Admin — minimal / edge deployments
PlatformArchitectureAccess
macOSx86_64 · aarch64Proxy :19530 · WebUI http://localhost:19531
Linuxx86_64 · aarch64Proxy :19530 · WebUI http://localhost:19531
Windowsx64 · ARM64Proxy :19530 · WebUI http://localhost:19531

Installation

Desktop App

Homebrew (macOS / Linux)

brew tap nyroway/nyro
brew install --cask nyro

Shell Script

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/nyroway/nyro/master/scripts/install/install.sh | bash

# Windows (PowerShell)
irm https://raw.githubusercontent.com/nyroway/nyro/master/scripts/install/install.ps1 | iex

Manual Download

Download the latest installer for your platform from GitHub Releases.

macOS: After manual install run sudo xattr -rd com.apple.quarantine /Applications/Nyro.app, or use the install script which handles this automatically.

Windows: SmartScreen may show "Unknown publisher" — click More info → Run anyway.

Server Binary

# Download
curl -LO https://github.com/nyroway/nyro/releases/latest/download/nyro-server-linux-x86_64
chmod +x nyro-server-linux-x86_64

# Start (localhost only, no auth required) — default all mode
./nyro-server-linux-x86_64

# Start (network-exposed, auth required)
./nyro-server-linux-x86_64 \
  --proxy-host 0.0.0.0 \
  --admin-host 0.0.0.0 \
  --admin-token YOUR_ADMIN_TOKEN

# Proxy-only mode — binds :19530 only, no Admin API, no WebUI
./nyro-server-linux-x86_64 --mode proxy

# Admin-only mode — binds :19531 only (for internal systems to consume the control plane)
./nyro-server-linux-x86_64 \
  --mode admin \
  --admin-host 0.0.0.0 \
  --admin-token YOUR_ADMIN_TOKEN

# Standalone mode (YAML config, no DB/Admin/WebUI; --mode is ignored)
./nyro-server-linux-x86_64 --config config.yaml

Available server binaries: linux-x86_64, linux-aarch64, macos-x86_64, macos-aarch64, windows-x86_64.exe, windows-arm64.exe

Open http://localhost:19531 for the management UI. See Server docs and Standalone docs for full configuration reference.

SQL Storage Backends

Default behavior: local SQLite under --data-dir. To use PostgreSQL or MySQL:

# PostgreSQL
./nyro-server-linux-x86_64 \
  --storage-backend postgres \
  --postgres-dsn "postgres://user:pass@host:5432/db"

# MySQL
./nyro-server-linux-x86_64 \
  --storage-backend mysql \
  --mysql-dsn "mysql://user:pass@host:3306/db"

Or via environment variable:

export NYRO_POSTGRES_DSN="postgres://user:pass@host:5432/db"
./nyro-server-linux-x86_64 --storage-backend postgres

# or
export NYRO_MYSQL_DSN="mysql://user:pass@host:3306/db"
./nyro-server-linux-x86_64 --storage-backend mysql

Multi-replica Production Deployment

When running multiple nyro-server replicas behind a load balancer, all replicas must share the same database and the same admin token:

RequirementDetail
Shared DBUse --storage-backend postgres or mysql pointing to the same DSN across all replicas. SQLite cannot be shared.
Unified admin tokenSet the same --admin-token / NYRO_ADMIN_TOKEN on every replica.
Config syncReplicas poll the shared DB for config changes every --config-poll-interval seconds (default: 3 s). Route/model/provider changes propagate within one poll interval.
OAuth interactive flowsThe OAuth authorization callback must reach the same replica that initiated the session. Configure sticky sessions (session affinity) on your load balancer for the admin port (19531).

Health probes:

EndpointPortUse
GET /healthzproxy + adminLiveness — always 200
GET /readyzproxy + adminReadiness — 200 if DB reachable, 503 otherwise

Key environment variables:

NYRO_MODE=all                      # all (default) | proxy | admin
NYRO_ADMIN_TOKEN=<secret>          # Required when admin host is not loopback
NYRO_STORAGE_BACKEND=postgres      # postgres | mysql | sqlite (default)
NYRO_POSTGRES_DSN=postgres://...   # Required when backend=postgres
NYRO_MYSQL_DSN=mysql://...         # Required when backend=mysql
NYRO_CONFIG_POLL_INTERVAL=3        # Seconds between config epoch polls (default: 3, 0=disabled)
NYRO_WEBUI_DIR=/path/to/dist       # Serve WebUI from external directory instead of embedded assets (admin/all modes only)

Docker

Pre-built server images are distributed via the separate nyroway/docker-nyro repository and published to Docker Hub as nyroway/nyro.

Quick start:

docker run --rm \
  -e NYRO_ADMIN_TOKEN=change-me \
  -p 19530:19530 \
  -p 19531:19531 \
  -v nyro-data:/var/lib/nyro \
  nyroway/nyro:latest

Open http://127.0.0.1:19531 for the management UI. Use the same NYRO_ADMIN_TOKEN value as the Bearer token for admin API requests.

For Postgres- or MySQL-backed deployments and docker compose usage, see the docker-nyro README.


Quick Start

1. Add a Provider

Go to Providers → New. Enter your provider's Base URL and API key. Nyro auto-detects the protocol from the URL.

2. Create a Route

Go to Routes → New. Set a virtual model name (e.g. gpt-4o), select your provider and target model. Enable access control if needed.

3. Point your client at Nyro

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:19530/v1",
    api_key="your-proxy-key"  # or "no-auth" if access control is off
)

response = client.chat.completions.create(
    model="gpt-4o",  # matches your virtual model name
    messages=[{"role": "user", "content": "Hello"}]
)

4. Sync your AI tools (optional)

Go to Connect, select a route, and click Sync next to Claude Code, Codex, Gemini CLI, or OpenCode. Nyro writes the correct config automatically.


License

Copyright 2026 The Nyro Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

See the full license text in LICENSE.

Similar Projects

Discover other similar projects and AI models.

RepositoryGo
maximhq/bifrost

Open-source, high-performance AI gateway that works as your LLM gateway, MCP gateway and agent gateway. One OpenAI-compatible API for 10,000+ models, with failover, load balancing, semantic caching, virtual keys, budgets and MCP Code Mode. Works with any SDK or agent and adds under 200µs of overhead at 5k RPS.

10.1k
Dec 1, 2026
RepositoryGo
yanstd888/9routerx

9RouterX (9R Next Go Generation): Single-binary Go AI router, LLM gateway & 20-40% token saver. Route Claude Code, Cursor & Codex across 155 providers, 28 OAuth & 248 free models (24 keyless) — OpenAI, Claude, Gemini, DeepSeek, Groq, Ollama & MCP.

279
Nov 28, 2026
RepositoryRust
ThinkWatchProject/ThinkWatch

Self-hosted AI API and MCP gateway for organizations: SSO and RBAC, per-user identity for MCP tool calls, PII redaction and tool-call guards, rate limits, budgets, cost accounting and audit logs.

818
Dec 1, 2026
RepositoryPython
BerriAI/litellm

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

64.3k
Dec 2, 2026
RepositoryTypeScript
Portkey-AI/gateway

A blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.

13.5k
Nov 20, 2026
RepositoryTypeScript
APIParkLab/APIPark

Cloud native, ultra-high performance AI&API gateway, LLM API management, distribution system, open platform, supporting all AI APIs.🦄云原生、超高性能 AI&API网关,LLM API 管理、分发系统、开放平台,支持所有AI API,不限于OpenAI、Azure、Anthropic Claude、Google Gemini、DeepSeek、字节豆包、ChatGLM、文心一言、讯飞星火、通义千问、360 智脑、腾讯混元等主流模型,统一 API 请求和返回,API申请与审批,调用统计、负载均衡、多模型灾备。一键部署,开箱即用。

1.8k
Oct 27, 2026
RepositoryPython
mozilla-ai/otari

Open-source AI gateway you run yourself. One endpoint for 40+ providers, with virtual keys, budgets, and usage tracking.

986
Nov 30, 2026
RepositoryGo
yolorouter/yolorouter

A self-hosted, OpenAI-compatible LLM gateway with multi-provider failover, key rotation, and a built-in admin console.

404
Oct 28, 2026
RepositoryPython
0xzr/freellmpool

Free LLM gateway: 22 LLM providers, 178 enabled chat routes, 431 cataloged chat models; keyless start when available.

159
Nov 20, 2026