Skip to content
Projects

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.

How these counts are measured

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.

AI

docs/en/README.md

Original

📖 SRouter Documentation

Developer Guides, API Specifications, and Architectural References

License: MIT OpenAI Compatible Agents

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/messages integration and zero-persistence secret injection (srouter launch).
    • Cursor & Windsurf: Connecting via unified base URL and auto routing.
    • Cline & Roo Code: Multi-model fallback configuration.
    • Codex CLI: Native /v1/responses format mapping.
    • Zed & JetBrains AI: Emulated Ollama wire endpoints.
    • ChatGPT Secure MCP Tunnel: Using SRouter as an MCP inference provider over /mcp.
  • 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)
  • 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.

⚡ 5. Routing Engine & Architecture

🔒 6. Fallback Chains & Operational Management


Crafted with passion by Bayu Indra Sugiharto (@baiibayu) & community contributors.