baiibayu/srouter
baiibayu/srouter has 64 GitHub stars and 11 forks. GitHot measured 0 stars in 24 hours, +1 in 7 days, and +2 in 15 days. Last checked 2026-11-15 20:46 UTC. Last push 2026-11-06.
What you can do
- Full OpenAI surface (/v1/chat/completions, /v1/models, /v1/embeddings, /v1/images/generations, /v1/audio/*).
- Native Anthropic Messages API (/v1/messages) for seamless Claude Code support.
- Native Google Gemini API (/v1beta/models/*:generateContent).
- Native Ollama Emulation for local-first IDEs like Zed and JetBrains AI.
Measured star growth
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Never hit rate limits again. One OpenAI-compatible endpoint for 60+ providers & 1,200+ models — smart auto-fallback, prompt compression, 60-language dashboard. Plug into Claude Code, Cursor, Codex & more. Free, open-source, self-hosted.
AIdocs/en/README.md
Original📖 SRouter Documentation
Developer Guides, API Specifications, and Architectural References
Language:
🇺🇸 English •
🇮🇩 Bahasa Indonesia •
🇨🇳 简体中文
🧭 Welcome to SRouter Docs
This documentation hub covers everything you need to install, configure, and operate the SRouter smart AI gateway. SRouter turns dozens of free provider tiers into a unified, high-availability, local-first inference infrastructure.
📚 Documentation Tracks
🚀 1. Installation & Deployment
- Installation Guide: Detailed guide for NPX / Global CLI, Docker Compose, production server builds, and LAN configuration.
- Desktop Application: Menu-bar / system tray Electron application for macOS and Windows.
- Android with Termux: Run SRouter locally on Android devices using Node's built-in SQLite driver.
- Docker Deployment: Container volumes, security flags, and persistent data paths.
🤖 2. Coding Agents & IDE Integration
- Client Integration Guide:
- Claude Code: Native
/v1/messagesintegration and zero-persistence secret injection (srouter launch). - Cursor & Windsurf: Connecting via unified base URL and
autorouting. - Cline & Roo Code: Multi-model fallback configuration.
- Codex CLI: Native
/v1/responsesformat mapping. - Zed & JetBrains AI: Emulated Ollama wire endpoints.
- ChatGPT Secure MCP Tunnel: Using SRouter as an MCP inference provider over
/mcp.
- Claude Code: Native
- Client Profiles: Enforcing custom system prompts, token rules, and sampling params per client.
📡 3. API & Wire Protocols
- REST API Reference:
- OpenAI Chat Completions (
/v1/chat/completions) - Anthropic Messages API (
/v1/messages) - Google Gemini API (
/v1beta/models/*:generateContent) - Ollama Emulation (
/api/chat,/api/generate) - Text Embeddings (
/v1/embeddings) - Media Generation (
/v1/images/generations,/v1/audio/*,/v1/videos/*) - Agent Web Search & Fetch (
/v1/search,/v1/fetch)
- OpenAI Chat Completions (
- Idempotency & Retry Semantics: Request deduping and safe retries across distributed providers.
✂️ 4. Prompt Compression & Token Saver
- Compression Pipeline:
- Structure-aware and heuristic output pruning for
git diff, grep, and terminal output. - Compact repeated JSON structures to typically save 20–40% tokens per request.
- Context window trimming before routing to upstream providers.
- Structure-aware and heuristic output pruning for
⚡ 5. Routing Engine & Architecture
- Architecture Deep-Dive:
- High-level system design and failover mechanics.
- Multi-Bandit Scoring: How models are ranked in real time by latency and capability.
- Quota & Cooldown Engine: Tracking RPM/RPD/TPM per
(platform, model, key). - Streaming Pipeline: Low-latency SSE streaming pass-through and token parsing.
- Degraded Mode & Failover: Automatic key cooldowns and fallback cascades.
- Signed Catalog Sync: How model metadata auto-updates via Ed25519 signed feeds.
🔒 6. Fallback Chains & Operational Management
- Named Fallback Chains: Creating and managing custom routing chains (
auto:<profile>). - Proxy Transports: Outbound forward proxying vs Cloudflare Fetch Relay.
- Database Migrations: Schema evolution and SQLite migration management.
- Contributor Guide: Development loop, test expectations, and PR policies.