claudeers.
// RAG & Knowledge

SRouter

Local-first AI Gateway: Connect Claude Code, Cursor, Windsurf, & Cline to Antigravity, OpenAI, Claude, & Gemini. One endpoint, OAuth auto-refresh, quota pool…

// RAG & Knowledge[ cli ][ api ][ web ][ claude ]#claude#ai-gateway#ai-router#antigravity#auto-fallback#claude-code#cline#continue#rag◷ MIT$open-sourceupdated 30 days ago
Actively maintained
100/100
last commit 11 days ago
last release 17 days ago
releases 9
open issues 4
// star history

Install with your AI

Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.

Install and set up SRouter (git-clone project) into my current project.
Found on https://claudeers.com/srouter
Repo: https://github.com/seaavey/SRouter
Homepage/docs: https://www.npmjs.com/package/@srouter/cli
Detected install method: git-clone → git clone https://github.com/seaavey/SRouter
Category: rag. Platforms: cli, api, web.
Read the repo's README for exact setup and env vars, then install it and wire it into my project.

Claudeers Health Verdict:
active; community-verified: false. Confirm the source before running anything.
// or clone
git clone https://github.com/seaavey/SRouter

// compatibility

Platformscli, api, web
Operating systems—
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguageTypeScript

Get your FREE $2.50 API credits to access TickAtlas financial data ↗

⚡ SRouter

Local-first AI gateway & LLM proxy for OpenAI, Anthropic, and custom models.

Keep a single stable endpoint while SRouter routes requests, refreshes OAuth tokens, enforces quotas, and monitors live telemetry.

SRouter Dashboard Walkthrough

Quick Start • Providers • Coding Tools • Integrations • API • Docker


⚡ Quick Start

Get SRouter running locally in under a minute.

docker run -d \
  --name srouter \
  --restart unless-stopped \
  -p 3000:3000 \
  -p 1455:1455 \
  -v $HOME/.srouter:/root/.srouter \
  ghcr.io/seaavey/srouter:latest

Data is persisted on the host at ~/.srouter ($HOME/.srouter). Using a named volume like srouter_data:/root/.srouter will store data inside Docker at /var/lib/docker/volumes/srouter_data/_data instead of on the host.

Option B: Local Node.js

git clone https://github.com/seaavey/SRouter.git
cd SRouter
pnpm install
pnpm build
pnpm start

Open http://localhost:3000 to access the dashboard. Configure your provider accounts under Providers, generate a virtual key in API Keys, and test endpoints immediately in Playground.


🔌 Connect Coding Tools

Use @srouter/cli to configure AI developer tools with one command:

# Interactive setup wizard
npx @srouter/cli setup

# Check status & link tools
npx @srouter/cli doctor
npx @srouter/cli link claude --model claude-3-7-sonnet
npx @srouter/cli link opencode --model antigravity/gemini-3.7-flash-high

# Run tools directly wrapped in SRouter environment
npx @srouter/cli run claude

Manual Configuration (Cursor / Windsurf / Cline / Continue)

Point your editor or extension to your local SRouter instance:

  • Base URL: http://localhost:3000/v1
  • API Key: sr-live-your_key (or your master admin key)
  • Model: Any model from http://localhost:3000/v1/models (e.g. antigravity/gemini-3.7-flash-high, openai_codex/gpt-4o)

🌐 Supported Providers

SRouter normalizes authentication and protocol differences across all major model providers:

ProviderModel PrefixAuth MethodStreamingLive Quota
Google Antigravityantigravity/*OAuth 2.0 PKCE✅✅
OpenAI Codex / ChatGPTopenai_codex/*OAuth 2.0 PKCE✅✅
Anthropic Claudeanthropic/*API Key / OAuth✅✅
OpenCode Zenopencode_zen/*Free / Access Token✅✅
Amazon Q / Kirokiro/*SigV4 / API Key✅✅
Qoderqoder/*OAuth / Device Token✅✅
GoRoutergorouter/*API Key✅✅
BluesMindsbluesminds/*API Key✅✅
SeekAI / TabiTokenseekai/*, tabitoken/*API Key✅✅
Custom Endpointscustom/*Custom Headers✅Configurable

💻 Integrate

SRouter exposes standard OpenAI and Anthropic compatible interfaces.

OpenAI SDK (Python)

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:3000/v1",
    api_key="sr-live-your_virtual_key"
)

stream = client.chat.completions.create(
    model="antigravity/gemini-3.7-flash-high",
    messages=[{"role": "user", "content": "Explain vector embeddings in one sentence."}],
    stream=True
)

for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

Anthropic SDK (TypeScript)

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
    baseURL: "http://localhost:3000/v1",
    apiKey: "sr-live-your_virtual_key"
});

const message = await client.messages.create({
    model: "anthropic/claude-3-7-sonnet",
    max_tokens: 1024,
    messages: [{ role: "user", content: "Hello from SRouter!" }]
});

console.log(message.content[0].text);

cURL

curl -N http://localhost:3000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sr-live-your_virtual_key" \
  -d '{
    "model": "antigravity/gemini-3.7-flash-high",
    "messages": [{"role": "user", "content": "Ping!"}],
    "stream": true
  }'

🎯 Core Features

  • Unified Protocol Translation: Translate between OpenAI chat/completions and Anthropic messages formats dynamically.
  • Automated OAuth Refresh: Background daemon automatically keeps short-lived OAuth sessions refreshed without downtime.
  • Failover & Smart Combo Routing: Define cascade fallback chains to automatically recover from rate limits (429) or provider outages.
  • Token Saver Engine: System-level prompt compression and concise coding rules to cut inference cost.
  • Virtual API Keys: Issue scoped keys (sr-live-*) with individual rate limits, token quotas, and expiration windows.
  • Built-in Cloudflare Tunnel: Expose your local gateway securely to the internet with zero open ports directly from the UI.
  • Embedded Observability: Track exact token usage, cache efficiency, and estimated costs locally in SQLite WAL mode.

📡 API Endpoints

All gateway endpoints are served under /v1:

Inference & Models

MethodEndpointDescription
POST/v1/chat/completionsOpenAI chat completion (streaming supported)
POST/v1/messagesAnthropic messages endpoint
GET/v1/modelsList all discovered & connected models
GET/v1/models/:modelRetrieve specific model schema & capabilities

Management & Metrics

MethodEndpointDescription
GET/healthServer health check
GET/v1/quotaReal-time provider balance & reset countdowns
GET / POST/v1/providersRead or connect provider accounts
GET / POST/v1/keysManage virtual API keys
GET/v1/logsQuery request audit logs and token telemetry
GET / POST/v1/tunnel/*Manage Cloudflare Tunnel daemon state

🐳 Docker Compose

services:
  srouter:
    image: ghcr.io/seaavey/srouter:latest
    container_name: srouter
    restart: unless-stopped
    ports:
      - "3000:3000"
      - "1455:1455"
    volumes:
      - ${HOME}/.srouter:/root/.srouter
    environment:
      - PORT=3000
      - NODE_ENV=production

🛠️ Development

# Install dependencies
pnpm install

# Start local dev server (API + Dashboard with HMR)
pnpm dev

# Quality checks
pnpm lint
pnpm test
pnpm build

💬 Community & Updates

For the latest news, updates, and community discussions, follow our official WhatsApp Channel:

👉 Follow SRouter WhatsApp Channel


📄 License

Distributed under the MIT License.

// faq

What is SRouter?

Local-first AI Gateway: Connect Claude Code, Cursor, Windsurf, & Cline to Antigravity, OpenAI, Claude, & Gemini. One endpoint, OAuth auto-refresh, quota pooling & failover.. It is open-source on GitHub.

Is SRouter free to use?

SRouter is open-source under the MIT license, so it is free to use.

What category does SRouter belong to?

SRouter is listed under rag in the Claudeers registry of Claude-compatible tools.

9 views
★ 23 stars
unclaimed
updated 30 days ago

// embed badge

SRouter on Claudeers
[![Claudeers](https://claudeers.com/api/badge/srouter.svg)](https://claudeers.com/srouter)

// retro hit counter

SRouter hit counter
[![Hits](https://claudeers.com/api/counter/srouter.svg)](https://claudeers.com/srouter)

// reviews

// guestbook

0/500

// related in RAG & Knowledge

🔓

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant contex…

// ragthedotmack/⟨JavaScript⟩★ 95,595◷ Apache-2.0[ claude ]
🔓

✨ Light and Fast AI Assistant. Support: Web | iOS | MacOS | Android | Linux | Windows

// ragChatGPTNextWeb/⟨TypeScript⟩★ 88,803◷ MIT[ claude ]
🔓

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 60-95% fewer tokens, same answers. Library, proxy, MCP server.

// ragheadroomlabs-ai/⟨Python⟩★ 73,654◷ Apache-2.0[ claude ]
🔓

A light-weight and powerful meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.

// raggsd-build/⟨JavaScript⟩★ 64,462◷ MIT[ claude ]
→ see how SRouter connects across the ecosystem