+๐ฑ Android (Termux) details
```bash
-# Development mode
-npm run electron:dev
-
-# Build for your platform
-npm run electron:build # Current platform
-npm run electron:build:win # Windows (.exe)
-npm run electron:build:mac # macOS (.dmg) โ x64 & arm64
-npm run electron:build:linux # Linux (.AppImage)
-```
-
-### System Tray
-
-When minimized, OmniRoute lives in your system tray with quick actions:
-
-- Open dashboard
-- Change server port
-- Quit application
-
-๐ Full documentation: [`electron/README.md`](electron/README.md)
-
----
-
-## ๐ฑ Run on Android โ Your Phone is an AI Server
-
-> ๐ **NEW!** OmniRoute now runs natively on **Android** via [Termux](https://termux.dev) โ turn any phone or tablet into a fully functional AI gateway.
-
-
-
-๐ค **Your pocket-sized AI infrastructure** โ no root required, no desktop needed.
-
-
-
-### Why Run OmniRoute on Android?
-
-Your Android device is a surprisingly powerful server that's always with you. Here's what you unlock:
-
-| Benefit | Description |
-| -------------------------- | ------------------------------------------------------------------------------------------------------------------- |
-| ๐ **AI Gateway Anywhere** | Carry a fully operational AI proxy in your pocket โ coffee shops, airports, or any WiFi network |
-| ๐ธ **Zero Hardware Cost** | No need to buy a Raspberry Pi, VPS, or dedicated server โ your existing phone does it all |
-| ๐ **Always-On Server** | With Termux:Boot, OmniRoute starts automatically on device boot โ a true 24/7 personal AI server |
-| ๐ก **LAN AI Hub** | Serve AI to every device on your network โ laptops, tablets, other phones all connect to `http://PHONE_IP:20128/v1` |
-| ๐ก๏ธ **Offline-First** | When paired with self-hosted models (Ollama), your phone becomes a completely offline, private AI server |
-| ๐งณ **Travel-Friendly** | Perfect for developers who need their AI coding setup available on the go without cloud dependencies |
-| โก **ARM Native** | OmniRoute's `better-sqlite3` compiles natively on ARM โ no emulation overhead, real performance |
-
-### Quick Install (3 Commands)
-
-```bash
-# 1. Install prerequisites in Termux
pkg update && pkg install nodejs-lts python build-essential git
-
-# 2. Run OmniRoute
npx -y omniroute@latest
```
-That's it โ the dashboard is live at `http://localhost:20128` and accessible from your Android browser.
+Access from any device on the same network: `http://PHONE_IP:20128/v1`
-### Use Cases
-
-
-๐งโ๐ป Mobile Developer Workstation
-
-Connect a Bluetooth keyboard, open Termux, and you have a full AI-powered dev environment. Point Claude Code, Codex CLI, or any coding tool running on a paired laptop to your phone's OmniRoute endpoint.
+- ๐ Full guide: [`docs/TERMUX_GUIDE.md`](docs/TERMUX_GUIDE.md)
-๐ Home Network AI Server
+๐ฒ PWA details
-Dedicate an old Android phone as a permanent AI gateway on your home WiFi. All family devices and workstations route through it. With Termux:Boot, it survives reboots and stays always-on.
+- **Android (Chrome):** โฎ โ "Add to Home screen"
+- **iOS (Safari):** Share โ "Add to Home Screen"
+- **Desktop (Chrome/Edge):** Install icon in address bar
+- ๐ Full docs: [`docs/PWA_GUIDE.md`](docs/PWA_GUIDE.md)
-
-๐ Portable Demo Server
-
-Doing a presentation or workshop? Run OmniRoute on your phone and let attendees connect to your hotspot โ instant multi-user AI demo with zero cloud setup.
-
-
-
-
-๐ Privacy-First AI
-
-Combine with local Ollama models for a fully air-gapped AI assistant that runs entirely on your phone โ no data ever leaves the device.
-
-
-
-### Access From Other Devices
-
-Find your phone's IP and connect from any device on the same network:
-
-```bash
-# On your phone (Termux)
-ip addr show wlan0
-
-# From any device on the network
-curl http://PHONE_IP:20128/v1/models
-```
-
-๐ **Full setup guide with background execution, auto-boot, troubleshooting, and more:** [`docs/TERMUX_GUIDE.md`](docs/TERMUX_GUIDE.md)
-
----
-
-## ๐ฒ Progressive Web App (PWA) โ Install It Like a Native App
-
-> ๐ **NEW!** OmniRoute is a fully installable **Progressive Web App**. Add it to your home screen on Android, iOS, or desktop โ no app store needed.
-
-
-
-๐ฑ **Native app feel** โ fullscreen, offline-ready, instant launch from your home screen.
-
-
-
-### Why PWA?
-
-| Feature | What You Get |
-| ------------------------- | ------------------------------------------------------------------------------------------------------- |
-| ๐ฒ **One-Tap Install** | "Add to Home Screen" on any device โ works on Android (Chrome), iOS (Safari), and desktop (Chrome/Edge) |
-| ๐ฅ๏ธ **Fullscreen Mode** | No browser chrome, no address bar โ the dashboard fills the entire screen like a native app |
-| โก **Faster Loading** | Static assets are cached by the service worker โ subsequent launches are nearly instant |
-| ๐ก **Offline Resilience** | A dedicated offline page with live connectivity status appears when the network drops |
-| ๐ **Always Up-to-Date** | The service worker auto-updates cached assets when a new version is deployed |
-| ๐จ **Custom Branding** | Respects your Instance Name from Settings โ the installed app shows your custom name |
-
-### How to Install
-
-
-๐ฑ Android (Chrome)
-
-1. Open `http://YOUR_IP:20128` in Chrome
-2. Tap **โฎ** (three dots) โ **"Add to Home screen"** or **"Install app"**
-3. Confirm โ OmniRoute appears on your home screen with its own icon
-
-
-
-
-๐ iOS (Safari)
-
-1. Open `http://YOUR_IP:20128` in Safari
-2. Tap the **Share** button (box with arrow) โ **"Add to Home Screen"**
-3. Tap **Add** โ OmniRoute launches fullscreen from your home screen
-
-
-
-
-๐ฅ๏ธ Desktop (Chrome / Edge)
-
-1. Open the OmniRoute dashboard in Chrome or Edge
-2. Click the **install icon** in the address bar (or โฎ โ "Install OmniRoute...")
-3. Confirm โ OmniRoute opens as a standalone window, no tabs or address bar
-
-
-
-### PWA + Termux = Complete On-Device AI
-
-When running OmniRoute on Android via Termux, the PWA creates the perfect companion:
-
-```
-โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-โ Your Android Phone โ
-โ โ
-โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
-โ โ Termux โ โ PWA App โ โ
-โ โ (OmniRoute โโโโ (Dashboard โ โ
-โ โ Server) โ โ Client) โ โ
-โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
-โ localhost:20128 โ
-โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-```
-
-Your phone is both the **server** and the **client** โ a fully self-contained AI gateway in your pocket.
-
-๐ **Full PWA documentation with technical architecture, caching strategies, and customization:** [`docs/PWA_GUIDE.md`](docs/PWA_GUIDE.md)
-
---
## ๐ Bypass Geographic Blocks โ Use AI From Any Country
-> ๐ท๐บ ๐จ๐ณ ๐ฎ๐ท ๐จ๐บ ๐น๐ท **Are you in Russia, China, Iran, Cuba, Turkey, or any country where AI providers are blocked?** OmniRoute has you covered.
+> ๐ท๐บ ๐จ๐ณ ๐ฎ๐ท ๐จ๐บ ๐น๐ท **In Russia, China, Iran, or any blocked region?** OmniRoute's 3-level proxy system solves this completely.
-Many AI providers โ including OpenAI, Anthropic (Claude), Codex, and GitHub Copilot โ restrict access from certain countries and regions. Developers get frustrating errors like `unsupported_country_region_territory` or simply can't connect. **OmniRoute's built-in proxy system solves this completely.**
+| Level | Badge | Configure In | Use Case |
+| ------------------ | ----- | ------------------ | ------------------------------- |
+| **Global** | ๐ข | Settings โ Proxy | All traffic through one proxy |
+| **Per-Provider** | ๐ก | Provider โ Proxy | Only specific providers proxied |
+| **Per-Connection** | ๐ต | Connection โ Proxy | Each API key uses its own proxy |
-### 3-Level Proxy Architecture
+**What gets proxied:** API requests โ
โข OAuth flows โ
โข Connection tests โ
โข Token refresh โ
โข Model sync โ
-OmniRoute offers proxy configuration at **three independent levels**, giving you precise control over which traffic goes through which proxy:
-
-```
-โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-โ Your Device (Russia, China, etc.) โ
-โ โ
-โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
-โ โ OmniRoute Server โ โ
-โ โ โ โ
-โ โ Level 1: ๐ข GLOBAL PROXY โ โ
-โ โ โโ All traffic from all providers goes through proxy โ โ
-โ โ โ โ
-โ โ Level 2: ๐ก PER-PROVIDER PROXY โ โ
-โ โ โโ Only traffic for a specific provider (e.g. OpenAI) โ โ
-โ โ โ โ
-โ โ Level 3: ๐ต PER-CONNECTION PROXY โ โ
-โ โ โโ Individual API key/account uses its own proxy โ โ
-โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
-โ โ โ โ โ
-โ โ โ โ โ
-โ ๐ Proxy ๐ Proxy ๐ Proxy โ
-โ (US/EU) (Japan) (Singapore) โ
-โ โ โ โ โ
-โ โ โ โ โ
-โ OpenAI Claude Codex โ
-โ Gemini Anthropic Copilot โ
-โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-```
-
-### How It Works
-
-| Level | Badge | How to Configure | Use Case |
-| ------------------ | ----- | ---------------------------------------------- | ------------------------------------------------------------------------------------ |
-| **Global** | ๐ข | `Dashboard โ Settings โ Proxy` | Route **all** provider traffic through one proxy. Set it once, forget it. |
-| **Per-Provider** | ๐ก | `Dashboard โ Providers โ [Provider] โ Proxy` | Route only a specific provider (e.g., OpenAI) through a proxy โ leave others direct. |
-| **Per-Connection** | ๐ต | `Dashboard โ Providers โ [Connection] โ Proxy` | Each individual API key or account uses its own proxy endpoint. |
-
-### What Gets Proxied
-
-- โ
**API requests** โ All chat completions, embeddings, images, audio, etc.
-- โ
**OAuth flows** โ Token exchange goes through the proxy too, solving `unsupported_country_region_territory` errors
-- โ
**Connection tests** โ The "Test Connection" button uses the configured proxy
-- โ
**Token refresh** โ Background OAuth token renewal goes through proxy
-- โ
**Model sync** โ Model listing and discovery requests use the proxy
-
-### Supported Proxy Protocols
-
-| Protocol | Example | Notes |
-| ----------------- | ----------------------------------------- | ---------------------------------------------------- |
-| **HTTP/HTTPS** | `http://proxy.example.com:8080` | Standard web proxy |
-| **SOCKS5** | `socks5://proxy.example.com:1080` | Full SOCKS5 support (set `ENABLE_SOCKS5_PROXY=true`) |
-| **Authenticated** | `http://user:pass@proxy.example.com:8080` | Username/password authentication |
-
-### Proxy Registry โ Full Management
-
-OmniRoute includes a complete proxy registry stored in SQLite. You can **create, update, delete, import, and export** proxies via the dashboard or API:
-
-```bash
-# Create a proxy
-curl -X POST http://localhost:20128/api/v1/management/proxies \
- -H "Content-Type: application/json" \
- -d '{"name":"US Proxy","type":"http","host":"proxy.example.com","port":8080}'
-
-# Assign to global scope
-curl -X PUT http://localhost:20128/api/settings/proxy \
- -d '{"level":"global","proxy":{"type":"http","host":"proxy.example.com","port":8080}}'
-
-# Check which proxy resolves for a connection
-curl "http://localhost:20128/api/settings/proxy?resolve=connection-uuid"
-```
-
-Features: bulk assignment, upsert by host+port, health stats tracking, force delete, and automatic legacy migration.
+**Protocols:** HTTP/HTTPS, SOCKS5 (`ENABLE_SOCKS5_PROXY=true`), Authenticated proxies
### ๐ 1proxy โ Free Proxy Marketplace
-> ๐ **Contributed by [@oyi77](https://github.com/oyi77)** โ [#1847](https://github.com/diegosouzapw/OmniRoute/pull/1847)
+> Contributed by [@oyi77](https://github.com/oyi77) โ [#1847](https://github.com/diegosouzapw/OmniRoute/pull/1847)
-**Don't have your own proxy?** OmniRoute integrates with the [1proxy](https://1proxy-api.aitradepulse.com) community platform to provide **hundreds of free, validated proxies** from around the world:
+No proxy? Use the built-in **1proxy** integration for **hundreds of free, validated proxies** worldwide:
-| Feature | Description |
-| -------------------- | ------------------------------------------------------------------------------ |
-| **One-Click Sync** | Fetch up to 500 validated proxies from the 1proxy API |
-| **Quality Scores** | Each proxy rated 0-100 with latency, anonymity level, and Google access status |
-| **Country Filter** | Filter by country code (US, DE, JP, etc.) and protocol (HTTP/SOCKS5) |
-| **Auto-Rotation** | 3 strategies: `quality` (best first), `random`, `sequential` |
-| **Auto-Degradation** | Failed proxies lose 10 quality points; score โค10 โ marked inactive |
-| **Circuit Breaker** | Sync stops after 5 consecutive failures to protect stability |
-| **Dashboard Tab** | Full UI at `Settings โ 1proxy` with stats, filters, and sync controls |
+- One-click sync (up to 500 proxies) โข Quality scores (0-100) โข Country filter โข Auto-rotation (quality/random/sequential) โข Auto-degradation โข Circuit breaker
-```bash
-# Sync free proxies
-curl -X POST http://localhost:20128/api/settings/oneproxy -d '{}'
-# โ {"success":true,"added":127,"updated":45,"total":172}
+### Anti-Detection
-# Rotate to next best proxy
-curl -X POST http://localhost:20128/api/settings/oneproxy/rotate \
- -d '{"strategy":"quality"}'
-```
+- ๐ **TLS Fingerprint Spoofing** โ browser-like TLS via `wreq-js`
+- ๐ **CLI Fingerprint Matching** โ matches native CLI binary signatures
+- ๐ **Proxy IP Preservation** โ stealth + IP masking simultaneously
-### Anti-Detection Features
+๐ **Full proxy documentation:** [`docs/PROXY_GUIDE.md`](docs/PROXY_GUIDE.md)
-OmniRoute doesn't just route traffic through a proxy โ it also makes the traffic look legitimate:
-
-- ๐ **TLS Fingerprint Spoofing** โ Browser-like TLS fingerprint via `wreq-js` to bypass bot detection
-- ๐ **CLI Fingerprint Matching** โ Reorders headers and body fields to match native CLI binary signatures, reducing account flagging
-- ๐ **Proxy IP Preservation** โ Your stealth features work **on top of** the proxy IP โ you get both masking and authenticity
-
-### Quick Setup for Blocked Regions
-
-```bash
-# 1. Get a proxy in an allowed region (US, EU, Japan, etc.)
-# Use any SOCKS5/HTTP proxy provider โ or use 1proxy for free ones!
-
-# 2. Set it as the global proxy in OmniRoute
-# Dashboard โ Settings โ Proxy โ paste your proxy URL
-
-# 3. Done โ all providers now accessible
-# Badge shows: ๐ข proxy active (IP: xxx.xxx.xxx.xxx)
-```
-
-> ๐ก **Tip**: Use **per-provider proxies** if you only need to bypass blocks for specific providers. For example, set a US proxy only for OpenAI while accessing DeepSeek directly from China.
-
-๐ **Full proxy documentation with registry CRUD, 1proxy API reference, database schema, and troubleshooting:** [`docs/PROXY_GUIDE.md`](docs/PROXY_GUIDE.md)
+---
---
@@ -1605,7 +703,12 @@ Cerebras (cerebras/) โ Llama/Qwen world-fastest โ 1M tok/day
**Zero cost. Never stops coding.** Configure this as one OmniRoute combo and all fallbacks happen automatically โ no manual switching ever.
----
+> ๐ก **Understanding Dashboard Costs:**
+>
+> The "cost" displayed in the Usage Analytics page is **for tracking and comparison purposes only**.
+> OmniRoute itself **never charges you anything** โ it's free, open-source software running on your machine.
+> If your dashboard shows "$290 total cost" while using free models, that's how much you **saved** compared to paid API pricing.
+> Think of it as a **savings tracker**, not a bill.
---
@@ -1787,186 +890,63 @@ Then in `/dashboard/media` โ **Transcription** tab: upload any audio or video
## ๐ก Key Features
-OmniRoute v3.7+ is built as an operational platform, not just a relay proxy โ backed by **4,690+ automated tests** across 517 test files.
+OmniRoute v3.7+ is an operational platform, not just a relay proxy โ backed by **4,690+ automated tests** across 517 test files.
-### ๐ New โ v3.6.x Highlights (Apr 2026)
+| Category | Feature | Why It Matters |
+| -------------------- | -------------------------------------------------------------------------------- | ---------------------------------- |
+| ๐ง **Routing** | Smart 4-Tier Fallback (Subscription โ API โ Cheap โ Free) | Never stop coding, zero downtime |
+| | 13 Balancing Strategies + Custom Combos | Tailor routing to your exact needs |
+| | Task-Aware Smart Routing (coding/vision/analysis) | Right model for every task |
+| | Context Relay โ session handoffs during rotation | No lost context mid-conversation |
+| | Thinking Budget Controls (passthrough/auto/custom) | Control reasoning costs precisely |
+| ๐ **Translation** | OpenAI โ Claude โ Gemini โ Responses API | Works with ANY CLI tool |
+| | Auto Token Refresh (OAuth PKCE for 8 providers) | No manual re-login ever |
+| | Responses API โ full `/v1/responses` for Codex | First-class Codex compatibility |
+| ๐ต **Multi-Modal** | 10 APIs: chat, embed, images, video, music, TTS, STT, moderation, rerank, search | One endpoint for everything |
+| | Batch API โ asynchronous processing with Files API | Background bulk processing |
+| | OpenAPI 3.0 โ live auto-generated spec + Try-It UI | API-first development |
+| ๐ก๏ธ **Resilience** | Circuit Breakers + Connection Cooldown + Anti-Thundering Herd | Auto-recovery from failures |
+| | TLS Fingerprint Spoofing + CLI Fingerprint Matching | Stealth + anti-ban protection |
+| | Semantic + Signature Cache (two-tier) | Reduce costs + latency |
+| | Request Idempotency + Rate Limit Detection | No duplicate charges |
+| ๐ค **Protocols** | MCP Server โ 29 tools, 3 transports, 10 scopes | IDE/agent tool integration |
+| | A2A Server โ JSON-RPC 2.0, SSE streaming, task lifecycle | Agent-to-agent orchestration |
+| | ACP โ CLI agent discovery (14 agents + custom) | Universal agent onboarding |
+| ๐ **Observability** | Unified Logs (request/proxy/audit/console) + p50/p95/p99 | Full request telemetry |
+| | Health Dashboard โ uptime, breakers, cache, lockouts | Operational visibility |
+| | Cost Tracking + Budget Controls | Financial governance |
+| | Evaluation Framework โ golden set testing | Quality assurance |
+| โ๏ธ **Platform** | Desktop (Electron), Android (Termux), PWA | Run anywhere |
+| | Docker (AMD64 + ARM64) with Compose profiles | One-command deploy |
+| | Cloudflare / Tailscale / ngrok Tunnels | Instant public endpoint |
+| | 40+ languages with RTL support | Global accessibility |
+| ๐๏ธ **Compression** | 5-mode pipeline: off / lite / standard / aggressive / ultra | Save 15-75% tokens |
-| Feature | What It Does |
-| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
-| ๐ **V1 WebSocket Bridge** | OpenAI-compatible WebSocket traffic upgraded and proxied via `/v1/ws` โ full streaming over WS with session auth (API key or session cookie) |
-| ๐ **Sync Tokens & Config Bundle** | Issue/revoke sync tokens for config sync endpoints. Config bundles versioned with ETag for bandwidth-efficient polling |
-| ๐ง **GLM Thinking (glmt) Preset** | GLM Thinking registered first-class: 65 536 max tokens, 24 576 thinking budget, 900s timeout, usage sync & pricing โ Claude-compatible API |
-| ๐ข **Hybrid Token Counting** | Uses provider-side `/messages/count_tokens` when available; falls back to estimation โ accurate usage tracking without guessing |
-| ๐ฑ **Model Alias Auto-Seed** | 30+ cross-proxy dialect aliases normalised at startup โ no more routing mismatches |
-| ๐ก๏ธ **Safe Outbound Fetch** | All provider validation and model discovery go through a guarded fetch layer blocking private/local URLs with retry, timeout, and SSRF protection |
-| โณ **Wait For Cooldown** | Server-side chat retries when every candidate connection is cooling down; configurable `enabled`, `maxRetries`, and `maxRetryWaitSec` |
-| ๐ **Runtime Env Validation** | Startup validates all env vars with Zod schemas โ clear errors for missing secrets, invalid URLs, or wrong types |
-| ๐ **Compliance Audit Expansion** | Structured audit logs with pagination, request context, auth events, provider CRUD events, and SSRF-blocked validation logging |
-| ๐ **TPS Log Metric** | Log details modal shows Tokens Per Second (TPS) โ quick performance at-a-glance for every request |
-| ๐๏ธ **Uninstall / Full Uninstall** | `npm run uninstall` keeps data, `npm run uninstall:full` removes everything โ clean removal for all install methods |
-| ๐ง **OAuth Env Repair** | One-click "Repair env" action for OAuth providers restores missing env vars and fixes broken auth state |
-| ๐ **Graceful Electron Shutdown** | Electron `before-quit` shuts down Next.js gracefully, preventing SQLite WAL database locks on desktop close |
-| ๐๏ธ **Model Visibility Toggle** | Per-model visibility toggle (๐ icon) with search filter and active-count badge (`N/M active`) on provider pages |
-| ๐ง **Email Privacy Masking** | OAuth account emails masked (`di*****@g****.com`), full address visible on hover |
-| ๐ **Context Relay Strategy** | Combo strategy preserving session continuity via structured handoff summaries when accounts rotate mid-conversation |
-| ๐ก๏ธ **Proxy Hardening** | Token health check, API key validation, and undici dispatcher all honor proxy config |
-| โ ๏ธ **Node.js 24 Login Warning** | Login page proactively detects incompatible Node.js versions and shows a clear warning banner |
-| ๐ **Gemini PDF Attachments** | PDF attachments correctly routed to Gemini via `inline_data` and generic base64 detection |
-| ๐ **CodeQL Security Hardening** | Resolved SSRF, insecure randomness, polynomial ReDoS, and incomplete URL sanitization alerts |
+
+๐ What's New โ v3.6+ Highlights
-### ๐ New โ ClawRouter-Inspired Improvements (Mar 2026)
+- ๐ V1 WebSocket Bridge โ OpenAI-compatible WS at `/v1/ws`
+- ๐ Sync Tokens & Config Bundle โ versioned config sync with ETag
+- ๐ง GLM Thinking (glmt) โ 65K tokens, 24K thinking budget, Claude-compatible
+- ๐ข Hybrid Token Counting โ provider-side + estimation fallback
+- ๐ก๏ธ Safe Outbound Fetch โ SSRF protection on all provider calls
+- โณ Wait For Cooldown โ auto-retry after connection cooldowns
+- ๐ Runtime Env Validation โ Zod schemas at startup
+- ๐ Compliance Audit v2 โ pagination, auth events, SSRF logging
+- ๐ Webhooks โ event-driven with test firing and dashboard management
+- ๐๏ธ Vision Bridge โ image analysis guardrail before routing
+- โก Grok-4 Fast โ $0.20/$0.50/M, 30% faster than Gemini Flash
+- ๐ง GLM-5 via Z.AI โ 128K output, $0.5/1M
+- ๐ฎ MiniMax M2.5 โ reasoning + agentic at $0.3/1M
+- ๐ฏ toolCalling flag โ per-model tool capability in registry
+- ๐ Multilingual Intent Detection โ PT/ZH/ES/AR in AutoCombo
+- ๐ Benchmark-Driven Fallbacks โ real p95 latency feeds scoring
+- ๐ Request Deduplication โ content-hash dedup window
-| Feature | What It Does |
-| ------------------------------------ | ------------------------------------------------------------------------------------------- |
-| โก **Grok-4 Fast Family** | xAI models at $0.20/$0.50/M โ benchmarked 1143ms (30% faster than Gemini 2.5 Flash) |
-| ๐ง **GLM-5 via Z.AI** | 128K output context, $0.5/1M โ newest flagship from the GLM family |
-| ๐ฎ **MiniMax M2.5** | Reasoning + agentic tasks at $0.30/1M โ significant upgrade from M2.1 |
-| ๐ฏ **toolCalling Flag per Model** | Per-model `toolCalling: true/false` in registry โ AutoCombo skips non-tool-capable models |
-| ๐ **Multilingual Intent Detection** | PT/ZH/ES/AR keywords in AutoCombo scoring โ better model selection for non-English content |
-| ๐ **Benchmark-Driven Fallbacks** | Real p95 latency from live requests feeds combo scoring โ AutoCombo learns from actual data |
-| ๐ **Request Deduplication** | Content-hash based dedup window โ multi-agent safe, prevents duplicate charges |
-| ๐ **Pluggable RouterStrategy** | Extensible `RouterStrategy` interface โ add custom routing logic as plugins |
+
-### ๐ Previous v2.0.9+ โ Playground, CLI Fingerprints & ACP
-
-| Feature | What It Does |
-| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| ๐ฎ **Model Playground** | Dashboard page to test any model directly โ provider/model/endpoint selectors, Monaco Editor, streaming, abort, timing |
-| ๐ **CLI Fingerprint Matching** | Per-provider header/body ordering to match native CLI signatures โ toggle per provider in Settings > Security. **Your proxy IP is preserved** |
-| ๐ค **ACP Support (Agent Client Protocol)** | CLI agent discovery (Codex, Claude, Goose, Gemini CLI, OpenClaw + 9 more), process spawner, `/api/acp/agents` endpoint |
-| ๐ค **ACP Agents Dashboard** | Debug โบ Agents page โ grid of 14 agents with install status, version, custom agent form for any CLI tool. **OpenCode** users get a "Download opencode.json" button that auto-generates a ready-to-use config with all available models. |
-| ๐ง **Custom Model `apiFormat` Routing** | Custom models with `apiFormat: "responses"` now correctly route to the Responses API translator |
-| ๐ข **Codex Workspace Isolation** | Multiple Codex workspaces per email โ OAuth correctly separates connections by workspace ID |
-| ๐ **Electron Auto-Update** | Desktop app checks for updates + auto-install on restart |
-
-### ๐ค Agent & Protocol Operations (v2.0)
-
-| Feature | What It Does |
-| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
-| ๐ง **MCP Server (29 tools)** | IDE/agent tools via 3 transports: stdio, SSE (`/api/mcp/sse`), Streamable HTTP (`/api/mcp/stream`). 20 core + 2 cache + 3 memory + 4 skill tools |
-| ๐ค **A2A Server (JSON-RPC + SSE)** | Agent-to-agent task execution with sync and streaming flows |
-| ๐งญ **Consolidated Endpoints Page** | Tabbed management page with Endpoint Proxy, MCP, A2A, and API Endpoints tabs |
-| ๐๏ธ **Service Enable/Disable Toggles** | ON/OFF switches for MCP and A2A with settings persistence (default: OFF) |
-| ๐ฐ๏ธ **MCP Runtime Heartbeat** | Real process status (pid, uptime, heartbeat age, transport, scope mode) |
-| ๐ **MCP Audit Trail** | Filterable audit logs with success/failure and key attribution |
-| ๐ **MCP Scope Enforcement** | 10 granular scope permissions for controlled tool access |
-| ๐ก **A2A Task Lifecycle Management** | List/filter tasks, inspect events/artifacts, cancel running tasks |
-| ๐ **Agent Card Discovery** | `/.well-known/agent.json` for client auto-discovery |
-| ๐งช **Protocol E2E Test Harness** | Real MCP SDK + A2A client flows in `test:protocols:e2e` |
-| โ๏ธ **Operational Controls** | Switch combos, tune resilience settings, and review breaker state from dedicated Health and Settings surfaces |
-
-### ๐ง Routing & Intelligence
-
-| Feature | What It Does |
-| ---------------------------------- | ------------------------------------------------------------------------ |
-| ๐ฏ **Smart 4-Tier Fallback** | Auto-route: Subscription โ API Key โ Cheap โ Free |
-| ๐ **Real-Time Quota Tracking** | Live token count + reset countdown per provider |
-| ๐ **Format Translation** | OpenAI โ Claude โ Gemini โ Responses with schema-safe conversions |
-| ๐ฅ **Multi-Account Support** | Multiple accounts per provider with intelligent selection |
-| ๐ **Auto Token Refresh** | OAuth tokens refresh automatically with retry |
-| ๐จ **Custom Combos** | 13 balancing strategies + fallback chain control |
-| ๐ **Context Relay** | Session continuity handoffs when account rotation happens mid-session |
-| ๐ **Wildcard Router** | `provider/*` dynamic routing |
-| ๐ง **Thinking Budget Controls** | Passthrough, auto, custom, and adaptive reasoning limits |
-| ๐ **Model Aliases** | Built-in + custom model aliasing and migration safety |
-| โก **Background Degradation** | Route low-priority background tasks to cheaper models |
-| ๐งช **Task-Aware Smart Routing** | Auto-select model by content type (coding/vision/analysis/summarization) |
-| ๐ **A2A Agent Workflows** | Deterministic FSM orchestrator for stateful multi-step agent executions |
-| ๐ **Adaptive Routing** | Dynamic strategy override based on token volume and prompt complexity |
-| ๐ฒ **Provider Diversity** | Shannon entropy scoring balancing auto-combo traffic distribution |
-| ๐ฌ **System Prompt Injection** | Global behavior controls applied consistently |
-| ๐ **Responses API Compatibility** | Full `/v1/responses` support for Codex and advanced agentic workflows |
-
-### ๐ต Multi-Modal APIs
-
-| Feature | What It Does |
-| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| ๐ผ๏ธ **Image Generation** | `/v1/images/generations` with cloud and local backends |
-| ๐ **Embeddings** | `/v1/embeddings` for search and RAG pipelines |
-| ๐ค **Audio Transcription** | `/v1/audio/transcriptions` โ 7 providers (Deepgram Nova 3, AssemblyAI, Groq Whisper, HuggingFace, ElevenLabs, OpenAI, Azure), auto-language detection, MP4/MP3/WAV support |
-| ๐ **Text-to-Speech** | `/v1/audio/speech` โ 10 providers (ElevenLabs, OpenAI, Deepgram, Cartesia, PlayHT, HuggingFace, Nvidia NIM, Inworld, Coqui, Tortoise) with correct error messages |
-| ๐ฌ **Video Generation** | `/v1/videos/generations` (ComfyUI + SD WebUI workflows) |
-| ๐ต **Music Generation** | `/v1/music/generations` (ComfyUI workflows) |
-| ๐ก๏ธ **Moderations** | `/v1/moderations` safety checks |
-| ๐ **Reranking** | `/v1/rerank` for relevance scoring |
-| ๐ **Web Search** ๐ | `/v1/search` โ 5 providers (Serper, Brave, Perplexity, Exa, Tavily), 6,500+ free/month, auto-failover, cache |
-| ๐ฆ **Batch API** ๐ | `/v1/batches` โ asynchronous batch processing with Files API, job lifecycle (create/get/cancel), and dashboard management page |
-| ๐ **OpenAPI Spec** ๐ | `/api/openapi/spec` โ live, auto-generated OpenAPI 3.0 specification with interactive Try-It endpoint at `/api/openapi/try` |
-
-### ๐ก๏ธ Resilience, Security & Governance
-
-| Feature | What It Does |
-| ----------------------------------- | ------------------------------------------------------------------------------------------------------- |
-| ๐ **Provider Circuit Breakers** | Provider-wide trip/recover after fallback exhaustion with configurable thresholds |
-| ๐ **Daily Quota Lock** ๐ | Detects exhaustion signals and locks routing for the specific model until midnight |
-| ๐ฏ **Endpoint-Aware Models** | Custom models declare supported endpoints + API format |
-| ๐ก๏ธ **Anti-Thundering Herd** | Mutex + semaphore protections on retry/rate events |
-| ๐ง **Semantic + Signature Cache** | Cost/latency reduction with two cache layers |
-| โก **Request Idempotency** | Duplicate protection window |
-| ๐ **TLS Fingerprint Spoofing** | Browser-like TLS fingerprint โ **reduces bot detection and account flagging** |
-| ๐ **CLI Fingerprint Matching** | Matches native CLI request signatures โ **reduces ban risk while preserving proxy IP** |
-| ๐ **IP Filtering** | Allowlist/blocklist control for exposed deployments |
-| ๐ฆ **Request Queue & Pacing** | Configurable per-connection request buckets for RPM, spacing, concurrency, and max wait |
-| ๐ **Graceful Degradation** | Multi-layer capability fallbacks protecting core gateway operations |
-| ๐ **Config Audit Trail** | Diff-based change tracking preventing operational drift with simple rollbacks |
-| โณ **Provider Health Sync** | Proactive token expiration monitoring triggering alerts before authorization failures |
-| โ๏ธ **Connection Cooldown** | Retryable 408/429/5xx failures cool down a single connection with optional upstream hints |
-| ๐ช **Auto-Disable Banned Accounts** | Permanently blocked token accounts can be disabled automatically |
-| ๐ **API Key Management + Scoping** | Secure key issuance/rotation and model/provider controls |
-| ๐๏ธ **Scoped API Key Reveal** ๐ | Opt-in recovery of API keys via `ALLOW_API_KEY_REVEAL` |
-| ๐ก๏ธ **Protected `/models`** | Optional auth gating and provider hiding for model catalog |
-| ๐ก๏ธ **Safe Outbound Fetch** ๐ | Guarded fetch for provider calls โ blocks private/local URLs, retries, SSRF protection |
-| โณ **Wait For Cooldown** ๐ | Auto-retry chat after connection cooldowns; configurable `enabled`, `maxRetries`, and `maxRetryWaitSec` |
-| ๐ **Runtime Env Validation** ๐ | Zod-based env schema validation at startup with actionable error messages |
-| ๐ **Compliance Audit v2** ๐ | Pagination, request context, auth events, provider CRUD, and SSRF-blocked logging |
-| ๐ **Webhooks** ๐ | Event-driven webhook system with configurable endpoints, test firing, and per-hook management dashboard |
-| ๐๏ธ **Vision Bridge** ๐ | Guardrail system that intercepts image-bearing requests for vision model analysis before routing |
-| ๐๏ธ **Prompt Compression** ๐ | 5-mode compression pipeline (off/lite/aggressive/ultra/caveman) reducing token usage before upstream |
-
-### ๐ Observability & Analytics
-
-| Feature | What It Does |
-| -------------------------------- | ----------------------------------------------------- |
-| ๐ **Request + Proxy Logging** | Full request/response and proxy logging |
-| ๐ **Streamed Detailed Logs** | Reconstructs SSE payload streams cleanly into the UI |
-| ๐ท๏ธ **Real-Time Model Badges** ๐ | Live model status and daily quota countdown timers |
-| ๐ **Unified Logs Dashboard** | Request, proxy, audit, and console views in one page |
-| ๐ **Request Telemetry** | p50/p95/p99 latency and request tracing |
-| ๐ฅ **Health Dashboard** | Uptime, breaker states, lockouts, cache stats |
-| ๐ฐ **Cost Tracking** | Budget controls and per-model pricing visibility |
-| ๐ **Analytics Visualizations** | Model/provider usage insights and trend views |
-| ๐งช **Evaluation Framework** | Golden set testing with configurable match strategies |
-| ๐ก **Live Diagnostics** ๐ | Semantic cache bypass for accurate combo live testing |
-| ๐ **TPS Log Metric** ๐ | Tokens Per Second badge in log details modal |
-
-### โ๏ธ Deployment & Platform
-
-| Feature | What It Does |
-| ------------------------------ | --------------------------------------------------------------------------------- |
-| ๐ **Deploy Anywhere** | Localhost, VPS, Docker, Cloud environments |
-| ๐ **Cloudflare Tunnel** ๐ | One-click Quick Tunnel integration from the dashboard |
-| ๐ **Tailscale Tunnel** ๐ | Full Tailscale Funnel integration โ install, login, enable/disable from dashboard |
-| ๐ **ngrok Tunnel** ๐ | ngrok tunnel management via dashboard for public endpoint exposure |
-| ๐ฒ **Progressive Web App** ๐ | Installable PWA with fullscreen mode, service worker caching, and offline page |
-| ๐ฑ **Android (Termux)** ๐ | Run OmniRoute natively on Android via Termux โ ARM native, no root required |
-| ๐ **API Key Model Filtering** | Native /v1/models response filtered via assigned Bearer context roles |
-| โก **Smart Cache Bypass** | Configurable TTL heuristics and forced refetch controls |
-| ๐ **Backup/Restore** | Export/import and disaster recovery flows |
-| ๐ง **Onboarding Wizard** | First-run guided setup |
-| ๐ง **CLI Tools Dashboard** | One-click setup for popular coding tools |
-| ๐ฎ **Model Playground** | Test any provider/model/endpoint from the dashboard |
-| ๐ **Search Tools Dashboard** | Dedicated web search UI with provider comparison, reranking, and search history |
-| ๐ท๏ธ **Tag-Based Routing** ๐ | Route requests using custom tags and metadata for granular traffic control |
-| ๐ **CLI Fingerprint Toggle** | Per-provider fingerprint matching in Settings > Security |
-| ๐ **i18n (40+ languages)** | Full dashboard + docs language support with RTL coverage |
-| ๐งน **Clear All Models** | One-click model list clearing in provider details |
-| ๐๏ธ **Visibility Controls** ๐ | Hide sidebar items and Endpoint tunnel panels from Appearance Settings |
-| ๐ **Issue Templates** | Standardized GitHub templates for bugs and features |
-| ๐ **Custom Data Directory** | `DATA_DIR` override for storage location |
-| ๐ **V1 WebSocket Bridge** ๐ | OpenAI-compatible WebSocket traffic proxied via `/v1/ws` |
-| ๐ **Sync Tokens & Bundle** ๐ | Config sync tokens + versioned bundle endpoint with ETag support |
-
-### Feature Deep Dive
+
+๐ Feature Deep Dive โ Expanded Details
#### Smart fallback with practical cost control
@@ -1980,27 +960,108 @@ Combo: "my-coding-stack"
When quota, rate, or health fails, OmniRoute automatically moves to the next candidate without manual switching.
-#### Protocol management that is visible and operable
+#### Prompt Compression โ Token Savings Breakdown
-- MCP + A2A are discoverable in UI and docs (not hidden)
-- Protocol status APIs expose live operational data (`/api/mcp/*`, `/api/a2a/*`)
-- Dashboards include actions for day-2 ops (combo toggles, breaker resets, task cancellation)
+```
+Without compression: 47K tokens sent to LLM
+With Lite: 40K tokens sent (15% saved โ safe, always-on)
+With Standard: 33K tokens sent (30% saved โ caveman-speak rules)
+With Aggressive: 24K tokens sent (50% saved โ aging + summarization)
+With Ultra: 12K tokens sent (75% saved โ heuristic pruning)
+```
-#### Translator + validation workflow
+#### Format Translation โ Universal Compatibility
-The Translator area includes:
-
-- **Playground**: request transformation checks
-- **Chat Tester**: full request/response round-trip
-- **Test Bench**: multiple cases in one run
-- **Live Monitor**: real-time traffic view
-
-Plus protocol validation with real clients via `npm run test:protocols:e2e`.
+- **OpenAI** โ **Claude** โ **Gemini** โ **Cursor** โ **Kiro** โ **Vertex** โ **Antigravity** โ **Ollama** โ **Responses**
+- Your CLI tool sends OpenAI format โ OmniRoute translates โ Provider receives native format
> ๐ **[MCP Server README](open-sse/mcp-server/README.md)** โ Tool reference, IDE configs, and client examples
>
> ๐ **[A2A Server README](src/lib/a2a/README.md)** โ Skills, JSON-RPC methods, streaming, and task lifecycle
+
+
+---
+
+## ๐ฏ Use Cases โ Ready-Made Combo Playbooks
+
+### Case 1: "I have a Claude Pro subscription"
+
+**Problem:** Quota expires unused, rate limits during heavy coding sessions.
+
+```
+Combo: "maximize-claude"
+ 1. cc/claude-opus-4-7 (use subscription fully)
+ 2. glm/glm-5.1 (cheap backup when quota out โ $0.5/1M)
+ 3. kr/claude-sonnet-4.5 (free emergency fallback via Kiro)
+
+Compression: standard (caveman) โ saves 30% tokens = stretch quota further
+Monthly cost: $20 (subscription) + ~$3 (backup) = $23 total
+vs. $20 + hitting limits + lost productivity = frustration
+```
+
+### Case 2: "I want $0 forever"
+
+**Problem:** Can't afford subscriptions, need reliable AI for coding.
+
+```
+Combo: "free-forever"
+ 1. kr/claude-sonnet-4.5 (Claude 4.5 free unlimited via Kiro)
+ 2. if/kimi-k2-thinking (reasoning model free via Qoder)
+ 3. pol/gpt-5 (GPT-5 free via Pollinations โ no key)
+ 4. lc/longcat-flash-lite (50M tokens/day free backup)
+
+Compression: aggressive โ saves 50% tokens = double your free quota
+Monthly cost: $0
+Quality: Production-ready models + 50% token savings
+```
+
+### Case 3: "I need 24/7 coding, no interruptions"
+
+**Problem:** Deadlines, can't afford any downtime.
+
+```
+Combo: "always-on"
+ 1. cc/claude-opus-4-7 (best quality โ subscription)
+ 2. cx/gpt-5.5 (second subscription โ OpenAI)
+ 3. glm/glm-5.1 (cheap, resets daily โ $0.5/1M)
+ 4. minimax/MiniMax-M2.5 (cheapest paid โ $0.3/1M)
+ 5. kr/claude-sonnet-4.5 (free unlimited โ never fails)
+
+Compression: lite โ saves 15% tokens passively, zero risk
+Result: 5 layers of fallback = zero downtime
+Monthly cost: $20-200 (subscriptions) + $5-10 (backup)
+```
+
+### Case 4: "I'm in a blocked region (Russia, China, Iran...)"
+
+**Problem:** AI providers block my country, VPNs are slow.
+
+```
+Combo: "unblocked-ai"
+ 1. kr/claude-sonnet-4.5 (free via Kiro + proxy)
+ 2. pol/deepseek-r1 (Pollinations โ no geo-block)
+ 3. groq/llama-3.3-70b (Groq + proxy)
+
+Proxy: Global proxy set in Settings โ or per-provider proxy override
+Result: Access ALL providers from ANY country
+Monthly cost: $0 (free providers) + $0 (1proxy free marketplace)
+```
+
+### Case 5: "I want maximum token savings"
+
+**Problem:** Token costs are eating my budget, need to squeeze every token.
+
+```
+Combo: "ultra-saver"
+ 1. cc/claude-opus-4-7 (subscription โ best quality)
+ 2. glm/glm-5.1 (cheap backup)
+
+Compression: ultra โ saves 75% tokens
+Result: 10K token prompt โ 2.5K tokens sent
+Montly savings: ~$150-300/month in token costs for heavy users
+```
+
## ๐งช Evaluations (Evals)
OmniRoute includes a built-in evaluation framework to test LLM response quality against a golden set. Access it via **Analytics โ Evals** in the dashboard.
@@ -2026,426 +1087,165 @@ The pre-loaded "OmniRoute Golden Set" contains test cases for:
## ๐ Setup Guide
-### Protocol Setup (MCP + A2A)
+### Connect Your Coding Tool
-
-๐งฉ MCP Setup (Model Context Protocol)
+Point any OpenAI-compatible tool to OmniRoute:
-Start MCP transport in stdio mode:
-
-```bash
-omniroute --mcp
+```txt
+Base URL: http://localhost:20128/v1
+API Key: [from Dashboard โ Endpoints]
```
-Recommended validation flow:
+| Tool | Config Location |
+| --------------- | ----------------------------------------------------------------------------------------- |
+| **Claude Code** | `claude mcp add-server omniroute --type http --url http://localhost:20128/api/mcp/stream` |
+| **Codex CLI** | `OPENAI_BASE_URL=http://localhost:20128/v1 OPENAI_API_KEY=your-key codex` |
+| **Cursor** | Settings โ Models โ Add Model โ Override Base URL |
+| **Cline** | Extension settings โ Custom API Base URL |
+| **OpenClaw** | `OPENAI_BASE_URL=http://localhost:20128/v1 openclaw` |
+| **Gemini CLI** | Uses native OAuth via OmniRoute โ connect in Providers |
-1. Connect your MCP client over stdio.
-2. Run `omniroute_get_health`.
-3. Run `omniroute_list_combos`.
-4. Open `/dashboard/mcp` to confirm heartbeat, activity, and audit.
-
-Useful APIs for automation:
-
-- `GET /api/mcp/status`
-- `GET /api/mcp/tools`
-- `GET /api/mcp/audit`
-- `GET /api/mcp/audit/stats`
-
-
-
-
-๐ค A2A Setup (Agent2Agent)
-
-Enable A2A from **Endpoints โ A2A** before sending JSON-RPC tasks. When the toggle is off,
-`/api/a2a/status` reports `disabled` and `POST /a2a` returns HTTP 503.
-
-Discover the agent:
+### Protocols (MCP + A2A)
```bash
+# MCP (stdio transport)
+omniroute --mcp
+
+# A2A (JSON-RPC 2.0)
curl http://localhost:20128/.well-known/agent.json
```
-Send a task:
+### Key Environment Variables
-```bash
-curl -X POST http://localhost:20128/a2a \
- -H 'content-type: application/json' \
- -d '{"jsonrpc":"2.0","id":"setup-a2a","method":"message/send","params":{"skill":"quota-management","messages":[{"role":"user","content":"Summarize quota status."}]}}'
-```
+| Variable | Default | Purpose |
+| -------------------- | -------------- | ----------------------------------------- |
+| `PORT` | `20128` | API and dashboard port |
+| `DASHBOARD_PORT` | โ | Separate dashboard port (split-port mode) |
+| `REQUIRE_API_KEY` | `false` | Require API key for all requests |
+| `DATA_DIR` | `~/.omniroute` | Database and config storage |
+| `REQUEST_TIMEOUT_MS` | `600000` | Upstream response timeout |
-Manage lifecycle:
+
+๐ Full Setup Guide โ All CLI tools, protocols, and environment variables
-- `GET /api/a2a/status`
-- `GET /api/a2a/tasks`
-- `GET /api/a2a/tasks/:id`
-- `POST /api/a2a/tasks/:id/cancel`
+๐ **Complete documentation:**
-Operational UI:
+- [User Guide](docs/USER_GUIDE.md) โ Providers, combos, CLI integration
+- [API Reference](docs/API_REFERENCE.md) โ All endpoints with examples
+- [MCP Server](open-sse/mcp-server/README.md) โ 29 tools, IDE configs
+- [A2A Server](src/lib/a2a/README.md) โ JSON-RPC, skills, streaming
+- [Environment Config](docs/ENVIRONMENT.md) โ Complete `.env` reference
+- [VM Deployment](docs/VM_DEPLOYMENT_GUIDE.md) โ VM + nginx + Cloudflare
-- `/dashboard/a2a` for task/state/stream observability and smoke actions
+
+
+---
+
+## โ Frequently Asked Questions
+
+
+๐ Why does my dashboard show high costs if I'm using free models?
+
+The dashboard tracks your token usage and displays **estimated costs** as if you were using paid APIs directly. This is **not actual billing** โ it's a reference to show how much you're saving.
+
+**Example:**
+
+- **Dashboard shows:** "$290 total cost"
+- **Reality:** You're using Kiro + Qoder (FREE unlimited)
+- **Your actual cost:** **$0.00**
+- **What $290 means:** Amount you **saved** by using free models instead of paid APIs!
+
+The cost display is a "savings tracker" to help you understand your usage patterns and optimization opportunities.
-๐งช End-to-end protocol validation
+๐ณ Will I be charged by OmniRoute?
-Validate both protocols with real clients:
+**No.** OmniRoute is free, open-source software that runs on your own computer. It never charges you anything.
-```bash
-npm run test:protocols:e2e
-```
+**You only pay:**
-This verifies:
+- โ
**Subscription providers** (Claude Code $20/mo, Codex $20-200/mo) โ Pay them directly on their websites
+- โ
**API key providers** (DeepSeek, xAI, etc.) โ Pay them directly, OmniRoute just routes your requests
+- โ **OmniRoute itself** โ **Never charges anything, ever**
-- MCP SDK client connect/list/call
-- A2A discovery/send/stream/get/cancel
-- Cross-check data in MCP audit and A2A task management APIs
+OmniRoute is a local proxy/router. It doesn't have your credit card, can't send invoices, and has no billing system. It's completely free software.
-๐ณ Subscription Providers
+๐ Are FREE providers really unlimited?
-### Claude Code (Pro/Max)
+**Yes!** The current FREE providers are genuinely free with **no hidden charges**:
-```bash
-Dashboard โ Providers โ Connect Claude Code
-โ OAuth login โ Auto token refresh
-โ 5-hour + weekly quota tracking
+- **Kiro AI**: Free unlimited Claude Sonnet/Haiku via AWS Builder ID / Google / GitHub OAuth
+- **Qoder**: Free unlimited kimi-k2-thinking, qwen3-coder-plus, deepseek-r1 via PAT token
+- **Pollinations AI**: No API key needed โ GPT-5, Claude, DeepSeek, Llama 4
+- **LongCat Flash-Lite**: 50M tokens/day โ largest free quota available
+- **Cloudflare Workers AI**: 10K Neurons/day โ 50+ models at the edge
-Models:
- cc/claude-opus-4-7
- cc/claude-sonnet-4-5-20250929
- cc/claude-haiku-4-5-20251001
-```
-
-**Pro Tip:** Use Opus for complex tasks, Sonnet for speed. OmniRoute tracks quota per model!
-
-### OpenAI Codex (Plus/Pro)
-
-```bash
-Dashboard โ Providers โ Connect Codex
-โ OAuth login (port 1455)
-โ 5-hour + weekly reset
-
-Models:
- cx/gpt-5.2-codex
- cx/gpt-5.1-codex-max
-```
-
-#### Codex Account Limit Management (5h + Weekly)
-
-Each Codex account now has policy toggles in `Dashboard -> Providers`:
-
-- `5h` (ON/OFF): enforce the 5-hour window threshold policy.
-- `Weekly` (ON/OFF): enforce the weekly window threshold policy.
-- Threshold behavior: when an enabled window reaches >=90% usage, that account is skipped.
-- Rotation behavior: OmniRoute routes to the next eligible Codex account automatically.
-- Reset behavior: when the provider `resetAt` time passes, the account becomes eligible again automatically.
-
-Scenarios:
-
-- `5h ON` + `Weekly ON`: account is skipped when either window reaches threshold.
-- `5h OFF` + `Weekly ON`: only weekly usage can block the account.
-- `5h ON` + `Weekly OFF`: only 5-hour usage can block the account.
-- `resetAt` passed: account re-enters rotation automatically (no manual re-enable).
-
-### Gemini CLI (FREE 180K/month!)
-
-```bash
-Dashboard โ Providers โ Connect Gemini CLI
-โ Google OAuth
-โ 180K completions/month + 1K/day
-
-Models:
- gc/gemini-3-flash-preview
- gc/gemini-2.5-pro
-```
-
-**Best Value:** Huge free tier! Use this before paid tiers.
-
-### GitHub Copilot
-
-```bash
-Dashboard โ Providers โ Connect GitHub
-โ OAuth via GitHub
-โ Monthly reset (1st of month)
-
-Models:
- gh/gpt-5
- gh/claude-4.5-sonnet
- gh/gemini-3.1-pro-preview
-```
+OmniRoute just routes your requests to them โ there's no "catch" or future billing.
-๐ API Key Providers
+๐ฐ How do I minimize my actual AI costs?
-### NVIDIA NIM (FREE developer access โ 70+ models)
+**Free-First Strategy:**
-1. Sign up: [build.nvidia.com](https://build.nvidia.com)
-2. Get free API key (1000 inference credits included)
-3. Dashboard โ Add Provider โ NVIDIA NIM:
- - API Key: `nvapi-your-key`
+1. **Start with 100% free combo:**
-**Models:** `nvidia/llama-3.3-70b-instruct`, `nvidia/mistral-7b-instruct`, and 50+ more
+ ```
+ 1. kr/claude-sonnet-4.5 (Kiro โ unlimited free)
+ 2. if/kimi-k2-thinking (Qoder โ unlimited free)
+ 3. pol/gpt-5 (Pollinations โ no key needed)
+ ```
-**Pro Tip:** OpenAI-compatible API โ works seamlessly with OmniRoute's format translation!
+ **Cost: $0/month**
-### DeepSeek
+2. **Enable Prompt Compression** โ even `lite` mode saves ~15% passively
-1. Sign up: [platform.deepseek.com](https://platform.deepseek.com)
-2. Get API key
-3. Dashboard โ Add Provider โ DeepSeek
+3. **Add cheap backup** only if you need it:
-**Models:** `deepseek/deepseek-chat`, `deepseek/deepseek-coder`
+ ```
+ 4. glm/glm-5.1 ($0.5/1M tokens)
+ ```
-### Groq (Free Tier Available!)
+ **Additional cost: Only pay for what you actually use**
-1. Sign up: [console.groq.com](https://console.groq.com)
-2. Get API key (free tier included)
-3. Dashboard โ Add Provider โ Groq
+4. **Use subscription providers last** โ only if you already have them. OmniRoute helps maximize their value through quota tracking.
-**Models:** `groq/llama-3.3-70b`, `groq/mixtral-8x7b`
-
-**Pro Tip:** Ultra-fast inference โ best for real-time coding!
-
-### OpenRouter (100+ Models)
-
-1. Sign up: [openrouter.ai](https://openrouter.ai)
-2. Get API key
-3. Dashboard โ Add Provider โ OpenRouter
-
-**Models:** Access 100+ models from all major providers through a single API key.
-
-**Dashboard behavior:** OpenRouter models are managed from **Available Models**. Manual add, import, and auto-sync all update the same list.
-
-### Baidu Qianfan / ERNIE
-
-1. Sign up: [Baidu AI Cloud Qianfan](https://cloud.baidu.com/product/wenxinworkshop)
-2. Create a Qianfan API key
-3. Dashboard โ Add Provider โ Baidu Qianfan
-
-**Use:** `qianfan/ernie-4.5-turbo-128k`, `qianfan/ernie-x1-turbo-32k`, or any Qianfan OpenAI-compatible model ID.
-
-**Dashboard behavior:** Qianfan is registered as an OpenAI-compatible API key provider. Built-in ERNIE models are available immediately, and passthrough model IDs are accepted for newer Qianfan deployments.
+**Result:** Most users can operate at **$0/month** using only free tiers!
-๐ฐ Cheap Providers (Backup)
+๐๏ธ Will compression affect response quality?
-### GLM-4.7 (Daily reset, $0.6/1M)
+**No.** Compression only affects the **input** (your prompt), not the model's response. Each mode has been designed to preserve technical accuracy:
-1. Sign up: [Zhipu AI](https://open.bigmodel.cn/)
-2. Get API key from Coding Plan
-3. Dashboard โ Add API Key:
- - Provider: `glm`
- - API Key: `your-key`
+- **Lite** (~15%): Only whitespace/formatting โ zero semantic change
+- **Standard** (~30%): Removes filler words ("please", "I think", "basically") โ same meaning
+- **Aggressive** (~50%): Summarizes old messages + compresses tool outputs โ core context preserved
+- **Ultra** (~75%): Heuristic pruning โ use only when token budget is critical
-**Use:** `glm/glm-4.7`
-
-**Pro Tip:** Coding Plan offers 3ร quota at 1/7 cost! Reset daily 10:00 AM.
-
-### MiniMax M2.1 (5h reset, $0.20/1M)
-
-1. Sign up: [MiniMax](https://www.minimax.io/)
-2. Get API key
-3. Dashboard โ Add API Key
-
-**Use:** `minimax/MiniMax-M2.1`
-
-**Pro Tip:** Cheapest option for long context (1M tokens)!
-
-### Kimi K2 ($9/month flat)
-
-1. Subscribe: [Moonshot AI](https://platform.moonshot.ai/)
-2. Get API key
-3. Dashboard โ Add API Key
-
-**Use:** `kimi/kimi-latest`
-
-**Pro Tip:** Fixed $9/month for 10M tokens = $0.90/1M effective cost!
+Code blocks, URLs, JSON, and structured data are **always protected** from compression via the preservation engine.
-๐ FREE Providers (Emergency Backup)
+๐ Does OmniRoute work in countries where AI is blocked?
-### Qoder (5 FREE models via OAuth)
+**Yes!** OmniRoute has a 3-level proxy system:
-```bash
-Dashboard โ Connect Qoder
-โ Qoder OAuth login
-โ Unlimited usage
+1. **Global proxy** โ all requests go through your proxy
+2. **Per-provider proxy** โ different proxy per provider
+3. **Per-API-key proxy** โ different proxy per key
-Models:
- if/kimi-k2-thinking
- if/qwen3-coder-plus
- if/glm-4.7
- if/minimax-m2
- if/deepseek-r1
-```
+Plus the **1proxy free marketplace** for community-shared proxies. Users in Russia, China, Iran, and other restricted regions can access all 160+ providers through OmniRoute's proxy infrastructure.
-### Qwen (4 FREE models via Device Code)
-
-```bash
-Dashboard โ Connect Qwen
-โ Device code authorization
-โ Unlimited usage
-
-Models:
- qw/qwen3-coder-plus
- qw/qwen3-coder-flash
-```
-
-### Kiro (Claude FREE)
-
-```bash
-Dashboard โ Connect Kiro
-โ AWS Builder ID or Google/GitHub
-โ Unlimited usage
-
-Models:
- kr/claude-sonnet-4.5
- kr/claude-haiku-4.5
-```
-
-
-
-
-๐จ Create Combos
-
-### Example 1: Maximize Subscription โ Cheap Backup
-
-```
-Dashboard โ Combos โ Create New
-
-Name: premium-coding
-Models:
- 1. cc/claude-opus-4-7 (Subscription primary)
- 2. glm/glm-4.7 (Cheap backup, $0.6/1M)
- 3. minimax/MiniMax-M2.1 (Cheapest fallback, $0.20/1M)
-
-Use in CLI: premium-coding
-```
-
-### Example 2: Free-Only (Zero Cost)
-
-```
-Name: free-combo
-Models:
- 1. gc/gemini-3-flash-preview (180K free/month)
- 2. if/kimi-k2-thinking (unlimited)
- 3. qw/qwen3-coder-plus (unlimited)
-
-Cost: $0 forever!
-```
-
-
-
-
-๐ง CLI Integration
-
-### Cursor IDE
-
-```
-Settings โ Models โ Advanced:
- OpenAI API Base URL: http://localhost:20128/v1
- OpenAI API Key: [from OmniRoute dashboard]
- Model: cc/claude-opus-4-7
-```
-
-### Claude Code
-
-Use the **CLI Tools** page in the dashboard for one-click configuration, or edit `~/.claude/settings.json` manually.
-
-### Codex CLI
-
-```bash
-export OPENAI_BASE_URL="http://localhost:20128"
-export OPENAI_API_KEY="your-omniroute-api-key"
-
-codex "your prompt"
-```
-
-### OpenClaw
-
-**Option 1 โ Dashboard (recommended):**
-
-```
-Dashboard โ CLI Tools โ OpenClaw โ Select Model โ Apply
-```
-
-**Option 2 โ Manual:** Edit `~/.openclaw/openclaw.json`:
-
-```json
-{
- "models": {
- "providers": {
- "omniroute": {
- "baseUrl": "http://127.0.0.1:20128/v1",
- "apiKey": "sk_omniroute",
- "api": "openai-completions"
- }
- }
- }
-}
-```
-
-> **Note:** OpenClaw only works with local OmniRoute. Use `127.0.0.1` instead of `localhost` to avoid IPv6 resolution issues.
-
-### Cline / Continue / RooCode
-
-```
-Settings โ API Configuration:
- Provider: OpenAI Compatible
- Base URL: http://localhost:20128/v1
- API Key: [from OmniRoute dashboard]
- Model: if/kimi-k2-thinking
-```
-
-### OpenCode
-
-**Step 1:** Add OmniRoute as a custom provider:
-
-```bash
-opencode
-/connect
-# Select "Other" โ Enter ID: "omniroute" โ Enter your OmniRoute API key
-```
-
-**Step 2:** Create/edit `opencode.json` in your project root:
-
-```json
-{
- "$schema": "https://opencode.ai/config.json",
- "provider": {
- "omniroute": {
- "npm": "@ai-sdk/openai-compatible",
- "name": "OmniRoute",
- "options": {
- "baseURL": "http://localhost:20128/v1"
- },
- "models": {
- "cc/claude-sonnet-4-20250514": { "name": "Claude Sonnet 4" },
- "gg/gemini-2.5-pro": { "name": "Gemini 2.5 Pro" },
- "if/kimi-k2-thinking": { "name": "Kimi K2 (Free)" }
- }
- }
- }
-}
-```
-
-**Step 3:** Select the model in OpenCode:
-
-```bash
-/models
-# Select any OmniRoute model from the list
-```
-
-> **Tip:** Add any model available in your OmniRoute `/v1/models` endpoint to the `models` section. Use the format `provider/model-id` from your OmniRoute dashboard.
+See the [Proxy Guide](docs/PROXY_GUIDE.md) for setup instructions.
@@ -2453,251 +1253,17 @@ opencode
## ๐ Troubleshooting
-
-Click to expand troubleshooting guide
-
-**"Language model did not provide messages"**
-
-- Provider quota exhausted โ Check dashboard quota tracker
-- Solution: Use combo fallback or switch to cheaper tier
-
-**Rate limiting**
-
-- Subscription quota out โ Fallback to GLM/MiniMax
-- Add combo: `cc/claude-opus-4-7 โ glm/glm-4.7 โ if/kimi-k2-thinking`
-
-**OAuth token expired**
-
-- Auto-refreshed by OmniRoute
-- If issues persist: Dashboard โ Provider โ Reconnect
-
-**High costs**
-
-- Check usage stats in Dashboard โ Costs
-- Switch primary model to GLM/MiniMax
-- Use free tier (Gemini CLI, Qoder) for non-critical tasks
-
-**Dashboard/API ports are wrong**
-
-- `PORT` is the canonical base port (and API port by default)
-- `API_PORT` overrides only OpenAI-compatible API listener
-- `DASHBOARD_PORT` overrides only dashboard/Next.js listener
-- Set `NEXT_PUBLIC_BASE_URL` to your dashboard/public URL (for OAuth callbacks)
-
-**Cloud sync errors**
-
-- Verify `BASE_URL` points to your running instance
-- Verify `CLOUD_URL` points to your expected cloud endpoint
-- Keep `NEXT_PUBLIC_*` values aligned with server-side values
-
-**First login not working**
-
-- Check `INITIAL_PASSWORD` in `.env`
-- If unset, fallback password is `123456`
-
-**No request logs**
-
-- `call_logs` in SQLite stores summary metadata for the Request Logs table and analytics views
-- Detailed request/response payloads are written to `DATA_DIR/call_logs/` as one JSON artifact per request
-- Enable pipeline capture from Dashboard โ Logs โ Request Logs if you need detailed per-stage payloads
-- When pipeline capture is enabled, `CALL_LOG_PIPELINE_CAPTURE_STREAM_CHUNKS=false` skips stream chunks and `CALL_LOG_PIPELINE_MAX_SIZE_KB` controls the artifact cap in KB
-- `Export Logs` reads the artifact files on demand, while `Export All` includes the `call_logs/` directory alongside `storage.sqlite`
-- Set `APP_LOG_TO_FILE=true` if you also want application console logs in `logs/application/app.log`
-- Adjust `APP_LOG_MAX_FILE_SIZE`, `APP_LOG_RETENTION_DAYS`, `APP_LOG_MAX_FILES`, and `CALL_LOG_MAX_ENTRIES` as needed
-
-**Connection test shows "Invalid" for OpenAI-compatible providers**
-
-- Many providers don't expose a `/models` endpoint
-- OmniRoute v1.0.6+ includes fallback validation via chat completions
-- Ensure base URL includes `/v1` suffix
-
-### ๐ OAuth on a Remote Server
-
-
-
-
-> **โ ๏ธ Important for users running OmniRoute on a VPS, Docker, or any remote server**
-
-#### Why does Antigravity / Gemini CLI OAuth fail on remote servers?
-
-The **Antigravity** and **Gemini CLI** providers use **Google OAuth 2.0**. Google requires the `redirect_uri` in the OAuth flow to exactly match one of the pre-registered URIs in the app's Google Cloud Console.
-
-The OAuth credentials bundled in OmniRoute are registered **for `localhost` only**. When you access OmniRoute on a remote server (e.g. `https://omniroute.myserver.com`), Google rejects the authentication with:
-
-```
-Error 400: redirect_uri_mismatch
-```
-
-#### Solution: Configure your own OAuth credentials
-
-You need to create an **OAuth 2.0 Client ID** in Google Cloud Console with your server's URI.
-
-#### Step-by-step
-
-**1. Open Google Cloud Console**
-
-Go to: [https://console.cloud.google.com/apis/credentials](https://console.cloud.google.com/apis/credentials)
-
-**2. Create a new OAuth 2.0 Client ID**
-
-- Click **"+ Create Credentials"** โ **"OAuth client ID"**
-- Application type: **"Web application"**
-- Name: anything you like (e.g. `OmniRoute Remote`)
-
-**3. Add Authorized Redirect URIs**
-
-In the **"Authorized redirect URIs"** field, add:
-
-```
-https://your-server.com/callback
-```
-
-> Replace `your-server.com` with your server's domain or IP (include the port if needed, e.g. `http://45.33.32.156:20128/callback`).
-
-**4. Save and copy the credentials**
-
-After creating, Google will show the **Client ID** and **Client Secret**.
-
-**5. Set environment variables**
-
-In your `.env` (or Docker environment variables):
-
-```bash
-# For Antigravity:
-ANTIGRAVITY_OAUTH_CLIENT_ID=your-client-id.apps.googleusercontent.com
-ANTIGRAVITY_OAUTH_CLIENT_SECRET=GOCSPX-your-secret
-
-# For Gemini CLI:
-GEMINI_OAUTH_CLIENT_ID=your-client-id.apps.googleusercontent.com
-GEMINI_OAUTH_CLIENT_SECRET=GOCSPX-your-secret
-GEMINI_CLI_OAUTH_CLIENT_SECRET=GOCSPX-your-secret
-```
-
-**6. Restart OmniRoute**
-
-```bash
-# npm:
-npm run dev
-
-# Docker:
-docker restart omniroute
-```
-
-**7. Try connecting again**
-
-Dashboard โ Providers โ Antigravity (or Gemini CLI) โ OAuth
-
-Google will now redirect correctly to `https://your-server.com/callback`.
-
----
-
-#### Temporary workaround (without custom credentials)
-
-If you don't want to set up your own credentials right now, you can still use the **manual URL flow**:
-
-1. OmniRoute opens the Google authorization URL
-2. After authorizing, Google tries to redirect to `localhost` (which fails on the remote server)
-3. **Copy the full URL** from your browser's address bar (even if the page doesn't load)
-4. Paste that URL into the field shown in the OmniRoute connection modal
-5. Click **"Connect"**
-
-> This works because the authorization code in the URL is valid regardless of whether the redirect page loaded.
-
----
-
-
-๐ง๐ท Versรฃo em Portuguรชs
-
-#### Por que o OAuth do Antigravity / Gemini CLI falha em servidores remotos?
-
-Os provedores **Antigravity** e **Gemini CLI** usam **Google OAuth 2.0** para autenticaรงรฃo. O Google exige que a `redirect_uri` usada no fluxo OAuth seja **exatamente** uma das URIs prรฉ-cadastradas no Google Cloud Console do aplicativo.
-
-As credenciais OAuth embutidas no OmniRoute estรฃo cadastradas **apenas para `localhost`**. Quando vocรช acessa o OmniRoute em um servidor remoto (ex: `https://omniroute.meuservidor.com`), o Google rejeita a autenticaรงรฃo com:
-
-```
-Error 400: redirect_uri_mismatch
-```
-
-#### Soluรงรฃo: Configure suas prรณprias credenciais OAuth
-
-Vocรช precisa criar um **OAuth 2.0 Client ID** no Google Cloud Console com a URI do seu servidor.
-
-#### Passo a passo
-
-**1. Acesse o Google Cloud Console**
-
-Abra: [https://console.cloud.google.com/apis/credentials](https://console.cloud.google.com/apis/credentials)
-
-**2. Crie um novo OAuth 2.0 Client ID**
-
-- Clique em **"+ Create Credentials"** โ **"OAuth client ID"**
-- Tipo de aplicativo: **"Web application"**
-- Nome: escolha qualquer nome (ex: `OmniRoute Remote`)
-
-**3. Adicione as Authorized Redirect URIs**
-
-No campo **"Authorized redirect URIs"**, adicione:
-
-```
-https://seu-servidor.com/callback
-```
-
-> Substitua `seu-servidor.com` pelo domรญnio ou IP do seu servidor (inclua a porta se necessรกrio, ex: `http://45.33.32.156:20128/callback`).
-
-**4. Salve e copie as credenciais**
-
-Apรณs criar, o Google mostrarรก o **Client ID** e o **Client Secret**.
-
-**5. Configure as variรกveis de ambiente**
-
-No seu `.env` (ou nas variรกveis de ambiente do Docker):
-
-```bash
-# Para Antigravity:
-ANTIGRAVITY_OAUTH_CLIENT_ID=seu-client-id.apps.googleusercontent.com
-ANTIGRAVITY_OAUTH_CLIENT_SECRET=GOCSPX-seu-secret
-
-# Para Gemini CLI:
-GEMINI_OAUTH_CLIENT_ID=seu-client-id.apps.googleusercontent.com
-GEMINI_OAUTH_CLIENT_SECRET=GOCSPX-seu-secret
-GEMINI_CLI_OAUTH_CLIENT_SECRET=GOCSPX-seu-secret
-```
-
-**6. Reinicie o OmniRoute**
-
-```bash
-# Se usando npm:
-npm run dev
-
-# Se usando Docker:
-docker restart omniroute
-```
-
-**7. Tente conectar novamente**
-
-Dashboard โ Providers โ Antigravity (ou Gemini CLI) โ OAuth
-
-Agora o Google redirecionarรก corretamente para `https://seu-servidor.com/callback` e a autenticaรงรฃo funcionarรก.
-
----
-
-#### Workaround temporรกrio (sem configurar credenciais prรณprias)
-
-Se nรฃo quiser criar credenciais prรณprias agora, ainda รฉ possรญvel usar o fluxo **manual de URL**:
-
-1. O OmniRoute abrirรก a URL de autorizaรงรฃo do Google
-2. Apรณs vocรช autorizar, o Google tentarรก redirecionar para `localhost` (que falha no servidor remoto)
-3. **Copie a URL completa** da barra de endereรงo do seu browser (mesmo que a pรกgina nรฃo carregue)
-4. Cole essa URL no campo que aparece no modal de conexรฃo do OmniRoute
-5. Clique em **"Connect"**
-
-> Este workaround funciona porque o cรณdigo de autorizaรงรฃo na URL รฉ vรกlido independente do redirect ter carregado ou nรฃo.
-
-
-
----
-
-
+| Problem | Quick Fix |
+| --------------------------------------------- | ------------------------------------------------------------------------------- |
+| **"Language model did not provide messages"** | Provider quota exhausted โ check quota tracker, use combo fallback |
+| **Rate limiting (429)** | Add fallback combo: `cc/claude โ glm/glm-4.7 โ if/kimi-k2-thinking` |
+| **OAuth token expired** | Auto-refreshed by OmniRoute. If stuck: delete + re-auth in Providers |
+| **`unsupported_country_region_territory`** | Configure proxy in Settings โ Proxy (see [Proxy Guide](docs/PROXY_GUIDE.md)) |
+| **Docker SQLite locks** | Use `--stop-timeout 40` for clean WAL checkpoint on shutdown |
+| **Node.js 24+ errors** | Downgrade to Node.js 18-22 LTS โ `better-sqlite3` is incompatible with Node 24+ |
+| **`system-info` for bug reports** | Run `npm run system-info` and attach `system-info.txt` to your issue |
+
+๐ **Full troubleshooting guide:** [`docs/TROUBLESHOOTING.md`](docs/TROUBLESHOOTING.md)
## ๐ ๏ธ Tech Stack
@@ -2726,29 +1292,60 @@ Se nรฃo quiser criar credenciais prรณprias agora, ainda รฉ possรญvel usar o flux
## ๐ Documentation
-| Document | Description |
-| -------------------------------------------------------- | --------------------------------------------------- |
-| [User Guide](docs/USER_GUIDE.md) | Providers, combos, CLI integration, deployment |
-| [API Reference](docs/API_REFERENCE.md) | All endpoints with examples |
-| [MCP Server](open-sse/mcp-server/README.md) | 29 MCP tools, IDE configs, Python/TS/Go clients |
-| [A2A Server](src/lib/a2a/README.md) | JSON-RPC 2.0 protocol, skills, streaming, task mgmt |
-| [Auto-Combo Engine](docs/AUTO-COMBO.md) | 6-factor scoring, mode packs, self-healing |
-| [Context Relay](docs/features/context-relay.md) | Session handoff strategy for account rotation |
-| [Troubleshooting](docs/TROUBLESHOOTING.md) | Common problems and solutions |
-| [Architecture](docs/ARCHITECTURE.md) | System architecture and internals |
-| [Codebase Documentation](docs/CODEBASE_DOCUMENTATION.md) | Beginner-friendly codebase walkthrough |
-| [Uninstall Guide](docs/UNINSTALL.md) | Clean removal for all install methods |
-| [Environment Config](docs/ENVIRONMENT.md) | Complete `.env` variables and references |
-| [Contributing](CONTRIBUTING.md) | Development setup and guidelines |
-| [OpenAPI Spec](docs/openapi.yaml) | OpenAPI 3.0 specification |
-| [Security Policy](SECURITY.md) | Vulnerability reporting and security practices |
-| [VM Deployment](docs/VM_DEPLOYMENT_GUIDE.md) | Complete guide: VM + nginx + Cloudflare setup |
-| [Features Gallery](docs/FEATURES.md) | Visual dashboard tour with screenshots |
-| [Release Checklist](docs/RELEASE_CHECKLIST.md) | Pre-release validation steps |
-| [PWA Guide](docs/PWA_GUIDE.md) | Progressive Web App install, caching, architecture |
-| [Proxy Guide](docs/PROXY_GUIDE.md) | Proxy system, 1proxy marketplace, registry CRUD |
-| [Free Tiers](docs/FREE_TIERS.md) | 25+ free API providers consolidated directory |
-| [Termux Guide](docs/TERMUX_GUIDE.md) | Run OmniRoute on Android via Termux |
+### ๐ Getting Started
+
+| Document | Description |
+| ------------------------------------- | ----------------------------------------------------------------------------- |
+| [User Guide](docs/USER_GUIDE.md) | Providers, combos, CLI integration, deployment |
+| [Setup Guide](docs/SETUP_GUIDE.md) | Full install methods, CLI tool configs, protocol setup, timeout tuning |
+| [CLI Tools Guide](docs/CLI-TOOLS.md) | Per-tool setup for Claude Code, Codex, Cursor, Cline, OpenClaw, Kilo, Copilot |
+| [Quick Start](README.md#-quick-start) | 3-step install โ connect โ configure |
+
+### ๐ง Operations & Deployment
+
+| Document | Description |
+| ---------------------------------------------------- | -------------------------------------------------------------- |
+| [Docker Guide](docs/DOCKER_GUIDE.md) | Docker run, Compose profiles, Caddy HTTPS, tunnels, image tags |
+| [VM Deployment](docs/VM_DEPLOYMENT_GUIDE.md) | Complete guide: VM + nginx + Cloudflare setup |
+| [Fly.io Deployment](docs/FLY_IO_DEPLOYMENT_GUIDE.md) | Deploy to Fly.io with persistent storage |
+| [Termux Guide](docs/TERMUX_GUIDE.md) | Run OmniRoute on Android via Termux |
+| [PWA Guide](docs/PWA_GUIDE.md) | Progressive Web App install, caching, architecture |
+| [Uninstall Guide](docs/UNINSTALL.md) | Clean removal for all install methods |
+| [Environment Config](docs/ENVIRONMENT.md) | Complete `.env` variables and references |
+
+### ๐ง Features & Architecture
+
+| Document | Description |
+| -------------------------------------------------------- | ---------------------------------------------------------------------- |
+| [Architecture](docs/ARCHITECTURE.md) | System architecture, data flow, and internals |
+| [Compression Guide](docs/COMPRESSION_GUIDE.md) | 5-mode pipeline: off / lite / standard / aggressive / ultra |
+| [Resilience Guide](docs/RESILIENCE_GUIDE.md) | Circuit breakers, cooldowns, queue, anti-thundering herd, TLS spoofing |
+| [Auto-Combo Engine](docs/AUTO-COMBO.md) | 6-factor scoring, mode packs, self-healing |
+| [Proxy Guide](docs/PROXY_GUIDE.md) | 3-level proxy system, 1proxy marketplace, registry CRUD |
+| [Free Tiers](docs/FREE_TIERS.md) | 25+ free API providers consolidated directory |
+| [Features Gallery](docs/FEATURES.md) | Visual dashboard tour with screenshots |
+| [Codebase Documentation](docs/CODEBASE_DOCUMENTATION.md) | Beginner-friendly codebase walkthrough |
+
+### ๐ค Protocols & APIs
+
+| Document | Description |
+| ------------------------------------------- | --------------------------------------------------- |
+| [API Reference](docs/API_REFERENCE.md) | All endpoints with examples |
+| [OpenAPI Spec](docs/openapi.yaml) | OpenAPI 3.0 specification |
+| [MCP Server](open-sse/mcp-server/README.md) | 29 MCP tools, IDE configs, Python/TS/Go clients |
+| [MCP Server Guide](docs/MCP-SERVER.md) | MCP installation, transports, and tool reference |
+| [A2A Server](src/lib/a2a/README.md) | JSON-RPC 2.0 protocol, skills, streaming, task mgmt |
+| [A2A Server Guide](docs/A2A-SERVER.md) | A2A agent card, tasks, skills, and streaming |
+
+### ๐ Project & Quality
+
+| Document | Description |
+| ---------------------------------------------- | ----------------------------------------------- |
+| [Contributing](CONTRIBUTING.md) | Development setup and guidelines |
+| [Security Policy](SECURITY.md) | Vulnerability reporting and security practices |
+| [i18n Guide](docs/I18N.md) | 40+ language support, translation workflow, RTL |
+| [Release Checklist](docs/RELEASE_CHECKLIST.md) | Pre-release validation steps |
+| [Coverage Plan](docs/COVERAGE_PLAN.md) | Test coverage strategy and 4,690+ test suite |
---
diff --git a/docs/COMPRESSION_GUIDE.md b/docs/COMPRESSION_GUIDE.md
new file mode 100644
index 0000000000..a6db971396
--- /dev/null
+++ b/docs/COMPRESSION_GUIDE.md
@@ -0,0 +1,183 @@
+# ๐๏ธ Prompt Compression Guide โ OmniRoute
+
+> Save 15-75% on token costs automatically. For a quick overview, see the [README Compression section](../README.md#%EF%B8%8F-prompt-compression--save-15-75-tokens-automatically).
+
+## Overview
+
+OmniRoute implements a modular prompt compression pipeline that runs **proactively** before requests hit upstream providers. This means your token savings happen transparently โ no changes needed to your workflow.
+
+```
+Client Request
+ โ Compression Strategy Selector
+ โ Combo override? โ Use combo setting
+ โ Auto-trigger threshold? โ Use auto mode
+ โ Default mode? โ Use global setting
+ โ Off? โ Skip compression
+ โ Selected Compression Mode
+ โ Off: No compression
+ โ Lite: Safe whitespace/formatting cleanup (~15%)
+ โ Standard: Caveman-speak filler removal (~30%)
+ โ Aggressive: History aging + summarization (~50%)
+ โ Ultra: Heuristic pruning + code-block thinning (~75%)
+ โ Compressed Request โ Provider
+```
+
+---
+
+## Compression Modes
+
+### Off
+
+No compression applied. All messages pass through unchanged.
+
+### Lite Mode (~15% savings, <1ms latency)
+
+The safest mode โ zero semantic change, only formatting cleanup:
+
+| Technique | Description |
+| ------------------------ | ------------------------------------------------- |
+| `collapseWhitespace` | Merge consecutive blank lines and trailing spaces |
+| `dedupSystemPrompt` | Remove duplicate system messages |
+| `compressToolResults` | Compress verbose tool/function outputs |
+| `removeRedundantContent` | Strip repeated instructions |
+| `replaceImageUrls` | Shorten base64 image data URIs |
+
+**Best for:** Always-on usage, safety-critical workflows.
+
+### Standard Mode (~30% savings)
+
+Inspired by [Caveman](https://github.com/JuliusBrussee/caveman) โ removes filler words and verbose phrasing while preserving meaning:
+
+- Removes filler words ("please", "I think", "basically", "actually")
+- Condenses verbose phrases ("in order to" โ "to", "as a result of" โ "because")
+- Strips polite hedging ("Would you mind...", "If you could possibly...")
+- 30+ regex rules tuned for coding prompts
+
+**Best for:** Daily coding workflows, cost-conscious teams.
+
+### Aggressive Mode (~50% savings)
+
+Smart history management for long sessions:
+
+- **Message Aging** โ older messages get progressively compressed
+- **Tool Result Summarization** โ long tool outputs replaced with summaries
+- **Structural Integrity Guards** โ ensures `tool_use` + `tool_result` pairs stay consistent
+- **Context Window Awareness** โ respects per-model token limits
+
+**Best for:** Extended debugging sessions, large codebases.
+
+### Ultra Mode (~75% savings)
+
+Maximum compression for token-critical scenarios:
+
+- **Heuristic Pruning** โ removes messages below relevance threshold
+- **Code Block Thinning** โ compresses repetitive code examples
+- **Binary Search Truncation** โ finds optimal cut point for context window
+- All Aggressive mode features included
+
+**Best for:** When you're hitting context limits repeatedly.
+
+---
+
+## Token Savings Visualization
+
+```
+Without compression: 47K tokens sent to LLM
+With Lite: 40K tokens sent (15% saved โ safe, always-on)
+With Standard: 33K tokens sent (30% saved โ caveman-speak rules)
+With Aggressive: 24K tokens sent (50% saved โ aging + summarization)
+With Ultra: 12K tokens sent (75% saved โ heuristic pruning)
+```
+
+---
+
+## Configuration
+
+### Dashboard
+
+Navigate to `Dashboard โ Settings โ Compression`:
+
+- **Default Mode** โ sets the system-wide compression mode
+- **Auto-Trigger Threshold** โ automatically engage compression when token count exceeds threshold
+- **Per-Combo Override** โ each combo can have its own compression mode
+
+### Per-Combo Override
+
+In `Dashboard โ Combos โ [Your Combo] โ Advanced`, set compression mode per combo:
+
+```txt
+Combo: "free-forever"
+ Mode: Standard
+ Targets:
+ 1. gc/gemini-3-flash
+ 2. if/kimi-k2-thinking
+```
+
+This lets you use aggressive compression on free providers while keeping lite mode on paid subscriptions.
+
+### API
+
+```bash
+# Get compression settings
+curl http://localhost:20128/api/settings/compression
+
+# Update compression settings
+curl -X PUT http://localhost:20128/api/settings/compression \
+ -H "Content-Type: application/json" \
+ -d '{"defaultMode":"lite","autoTriggerThreshold":32000}'
+```
+
+---
+
+## What Gets Protected
+
+The compression engine **always preserves:**
+
+- โ
Code blocks (fenced and inline)
+- โ
URLs and file paths
+- โ
JSON structures and structured data
+- โ
API keys, tokens, and identifiers
+- โ
Mathematical expressions
+- โ
Tool/function call definitions
+- โ
System prompts (in lite mode)
+
+---
+
+## Compression Stats
+
+Every compressed request includes stats in the server logs:
+
+```json
+{
+ "originalTokens": 47200,
+ "compressedTokens": 40120,
+ "savingsPercent": 15.0,
+ "techniquesUsed": ["collapseWhitespace", "dedupSystemPrompt"],
+ "mode": "lite",
+ "latencyMs": 0.8
+}
+```
+
+---
+
+## Phase Roadmap
+
+| Phase | Modes | Status |
+| ------- | ------------------------------------ | ---------- |
+| Phase 1 | Off, Lite | โ
Shipped |
+| Phase 2 | Standard, Aggressive, Ultra | โ
Shipped |
+| Phase 3 | Per-model adaptive, ML-based pruning | ๐๏ธ Planned |
+
+---
+
+## Acknowledgments
+
+Standard mode compression rules are inspired by **[Caveman](https://github.com/JuliusBrussee/caveman)** by **[JuliusBrussee](https://github.com/JuliusBrussee)** (โญ 51K+) โ the viral "why use many token when few token do trick" project.
+
+---
+
+## See Also
+
+- [Environment Config](ENVIRONMENT.md) โ Compression environment variables
+- [Architecture Guide](ARCHITECTURE.md) โ Compression pipeline internals
+- [User Guide](USER_GUIDE.md) โ Getting started with compression
diff --git a/docs/DOCKER_GUIDE.md b/docs/DOCKER_GUIDE.md
new file mode 100644
index 0000000000..771cf819d4
--- /dev/null
+++ b/docs/DOCKER_GUIDE.md
@@ -0,0 +1,119 @@
+# ๐ณ Docker Guide โ OmniRoute
+
+> Complete Docker deployment reference. For a quick start, see the [README Docker section](../README.md#-docker).
+
+## Table of Contents
+
+- [Quick Run](#quick-run)
+- [With Environment File](#with-environment-file)
+- [Docker Compose](#docker-compose)
+- [Docker Compose with Caddy (HTTPS)](#docker-compose-with-caddy-https-auto-tls)
+- [Cloudflare Quick Tunnel](#cloudflare-quick-tunnel)
+- [Image Tags](#image-tags)
+- [Important Notes](#important-notes)
+
+---
+
+## Quick Run
+
+```bash
+docker run -d \
+ --name omniroute \
+ --restart unless-stopped \
+ --stop-timeout 40 \
+ -p 20128:20128 \
+ -v omniroute-data:/app/data \
+ diegosouzapw/omniroute:latest
+```
+
+## With Environment File
+
+```bash
+# Copy and edit .env first
+cp .env.example .env
+
+docker run -d \
+ --name omniroute \
+ --restart unless-stopped \
+ --stop-timeout 40 \
+ --env-file .env \
+ -p 20128:20128 \
+ -v omniroute-data:/app/data \
+ diegosouzapw/omniroute:latest
+```
+
+## Docker Compose
+
+```bash
+# Base profile (no CLI tools)
+docker compose --profile base up -d
+
+# CLI profile (Claude Code, Codex, OpenClaw built-in)
+docker compose --profile cli up -d
+```
+
+## Docker Compose with Caddy (HTTPS Auto-TLS)
+
+OmniRoute can be securely exposed using Caddy's automatic SSL provisioning. Ensure your domain's DNS A record points to your server's IP.
+
+```yaml
+services:
+ omniroute:
+ image: diegosouzapw/omniroute:latest
+ container_name: omniroute
+ restart: unless-stopped
+ volumes:
+ - omniroute-data:/app/data
+ environment:
+ - PORT=20128
+ - NEXT_PUBLIC_BASE_URL=https://your-domain.com
+
+ caddy:
+ image: caddy:latest
+ container_name: caddy
+ restart: unless-stopped
+ ports:
+ - "80:80"
+ - "443:443"
+ command: caddy reverse-proxy --from https://your-domain.com --to http://omniroute:20128
+
+volumes:
+ omniroute-data:
+```
+
+## Cloudflare Quick Tunnel
+
+Dashboard support for Docker deployments includes a one-click **Cloudflare Quick Tunnel** on `Dashboard โ Endpoints`. The first enable downloads `cloudflared` only when needed, starts a temporary tunnel to your current `/v1` endpoint, and shows the generated `https://*.trycloudflare.com/v1` URL directly below your normal public URL.
+
+Endpoint tunnel panels (Cloudflare, Tailscale, ngrok) can be shown or hidden from `Settings โ Appearance` without changing active tunnel state.
+
+### Tunnel Notes
+
+- Quick Tunnel URLs are temporary and change after every restart.
+- Quick Tunnels are not auto-restored after an OmniRoute or container restart. Re-enable them from the dashboard when needed.
+- Managed install currently supports Linux, macOS, and Windows on `x64` / `arm64`.
+- Managed Quick Tunnels default to HTTP/2 transport to avoid noisy QUIC UDP buffer warnings in constrained container environments. Set `CLOUDFLARED_PROTOCOL=quic` or `auto` if you want a different transport.
+- Docker images bundle system CA roots and pass them to managed `cloudflared`, which avoids TLS trust failures when the tunnel bootstraps inside the container.
+- Set `CLOUDFLARED_BIN=/absolute/path/to/cloudflared` if you want OmniRoute to use an existing binary instead of downloading one.
+
+## Image Tags
+
+| Image | Tag | Size | Description |
+| ------------------------ | -------- | ------ | --------------------- |
+| `diegosouzapw/omniroute` | `latest` | ~250MB | Latest stable release |
+| `diegosouzapw/omniroute` | `3.7.8` | ~250MB | Current version |
+
+Multi-platform: AMD64 + ARM64 native (Apple Silicon, AWS Graviton, Raspberry Pi).
+
+## Important Notes
+
+- **SQLite WAL Mode:** `docker stop` should be allowed to finish so OmniRoute can checkpoint the latest changes back into `storage.sqlite`. The bundled Compose files already set a 40s stop grace period. If you run the image directly, keep `--stop-timeout 40`.
+- **`DISABLE_SQLITE_AUTO_BACKUP`:** Set to `true` if backups are managed externally.
+- **Data Persistence:** Always mount a volume to `/app/data` to persist your database, keys, and configurations across container restarts.
+- **Port Configuration:** Override `PORT` environment variable to change the default `20128` port.
+
+## See Also
+
+- [VM Deployment Guide](VM_DEPLOYMENT_GUIDE.md) โ VM + nginx + Cloudflare setup
+- [Fly.io Deployment Guide](FLY_IO_DEPLOYMENT_GUIDE.md) โ Deploy to Fly.io
+- [Environment Config](ENVIRONMENT.md) โ Complete `.env` reference
diff --git a/docs/RESILIENCE_GUIDE.md b/docs/RESILIENCE_GUIDE.md
new file mode 100644
index 0000000000..6c36add7ec
--- /dev/null
+++ b/docs/RESILIENCE_GUIDE.md
@@ -0,0 +1,145 @@
+# ๐ก๏ธ Resilience Guide โ OmniRoute
+
+> How OmniRoute keeps your AI coding workflow running when providers fail.
+
+## Overview
+
+OmniRoute implements a multi-layered resilience system that ensures zero downtime:
+
+```
+Client Request
+ โ Rate Limit Check (per-IP, per-connection)
+ โ Combo Routing (13 strategies)
+ โ Connection Selection (P2C, round-robin, etc.)
+ โ Request Queue & Pacing
+ โ Execute (provider-specific executor)
+ โ On Failure:
+ โ Connection Cooldown (exponential backoff)
+ โ Circuit Breaker (provider-level)
+ โ Wait For Cooldown (auto-retry)
+ โ Next Combo Target (fallback chain)
+ โ Response
+```
+
+---
+
+## Request Queue & Pacing
+
+Per-connection request buckets smooth bursts before they hit upstream rate caps.
+
+Configure in `Dashboard โ Settings โ Resilience`:
+
+| Setting | Default | Description |
+| --------------- | ------- | ------------------------------------ |
+| Queue Size | `10` | Max queued requests per connection |
+| Pacing Interval | `0ms` | Minimum gap between requests |
+| Max Concurrent | `5` | Simultaneous requests per connection |
+
+---
+
+## Connection Cooldown
+
+A single connection cools down after retryable failures. Features:
+
+- **Exponential Backoff** โ progressively longer cooldowns after each failure
+- **`Retry-After` Header Support** โ respects upstream hints
+- **Configurable Base/Max** โ tune cooldown duration per use case
+- **Auto-Recovery** โ connection automatically becomes available after cooldown expires
+
+---
+
+## Circuit Breaker
+
+Provider-level protection against cascading failures:
+
+1. **Connection-scoped `429` rate limits** stay in Connection Cooldown (don't trip the breaker)
+2. **Provider-wide transient errors** (5xx, network timeouts) increment the failure counter
+3. **Breaker trips** only after fallback is exhausted AND the provider still fails
+4. **Recovery** โ breaker automatically moves to half-open state after timeout, tests with probe request
+
+Configure thresholds in `Dashboard โ Settings โ Resilience`.
+
+---
+
+## Wait For Cooldown
+
+Instead of immediately failing when all connections are in cooldown, OmniRoute can wait for the earliest connection to expire and retry:
+
+- **Automatic** โ server waits for the earliest cooldown to expire
+- **Transparent** โ client sees a slightly delayed response instead of an error
+- **Configurable** โ enable/disable per combo or globally
+
+---
+
+## Anti-Thundering Herd
+
+When multiple concurrent requests hit a failing provider simultaneously:
+
+- **Mutex Protection** โ only one retry attempt at a time per connection
+- **Semaphore** โ limits concurrent retry storms across connections
+- **Deduplication** โ identical requests within 5s window are deduplicated
+
+---
+
+## Combo Fallback Chains
+
+The primary resilience mechanism. Configure in `Dashboard โ Combos`:
+
+```txt
+Combo: "always-on"
+ 1. cc/claude-opus-4-7 โ Primary (subscription)
+ 2. cx/gpt-5.2-codex โ Secondary (subscription)
+ 3. glm/glm-4.7 โ Cheap backup ($0.5/1M)
+ 4. if/kimi-k2-thinking โ Free fallback (unlimited)
+```
+
+When provider #1 fails (quota, rate, or health), OmniRoute automatically routes to #2, then #3, then #4 โ with zero manual intervention.
+
+### 13 Routing Strategies
+
+| Strategy | Description |
+| ------------------- | ---------------------------------- |
+| `priority` | First available in order |
+| `weighted` | Weighted distribution |
+| `fill-first` | Fill primary before moving |
+| `round-robin` | Rotate through all targets |
+| `p2c` | Power-of-two choices (quota-aware) |
+| `random` | Random selection |
+| `least-used` | Least recently used |
+| `cost-optimized` | Cheapest available |
+| `strict-random` | True random (no tracking) |
+| `auto` | OmniRoute selects based on context |
+| `lkgp` | Last Known Good Provider |
+| `context-optimized` | Best for current context window |
+| `context-relay` | Session handoff during rotation |
+
+---
+
+## TLS Fingerprint Spoofing
+
+OmniRoute makes proxied traffic look like legitimate browser/CLI requests:
+
+- **Browser-like TLS** via `wreq-js` โ prevents bot detection
+- **CLI Fingerprint Matching** โ reorders headers and body fields to match native CLI binary signatures (Claude Code, Codex, etc.)
+- **Proxy IP Preservation** โ stealth features work on top of proxy IP masking
+
+---
+
+## Health Dashboard
+
+Monitor all resilience components in real-time at `Dashboard โ Health`:
+
+- **Uptime** โ server uptime and last restart
+- **Provider Breaker States** โ open/closed/half-open per provider
+- **Connection Cooldowns** โ active cooldowns with expiry times
+- **Cache Stats** โ signature + semantic cache hit rates
+- **Lockouts** โ API key lockouts and IP bans
+- **Latency** โ p50/p95/p99 percentiles
+
+---
+
+## See Also
+
+- [Architecture Guide](ARCHITECTURE.md) โ System architecture and internals
+- [User Guide](USER_GUIDE.md) โ Providers, combos, CLI integration
+- [Auto-Combo Engine](AUTO-COMBO.md) โ 6-factor scoring, mode packs
diff --git a/docs/SETUP_GUIDE.md b/docs/SETUP_GUIDE.md
new file mode 100644
index 0000000000..9e78e203e9
--- /dev/null
+++ b/docs/SETUP_GUIDE.md
@@ -0,0 +1,311 @@
+# ๐ Setup Guide โ OmniRoute
+
+> Complete setup reference for OmniRoute. For the quick version, see the [Quick Start in README](../README.md#-quick-start).
+
+## Table of Contents
+
+- [Install Methods](#install-methods)
+- [CLI Tool Configuration](#cli-tool-configuration)
+- [Protocol Setup (MCP + A2A)](#protocol-setup-mcp--a2a)
+- [Timeout Configuration](#timeout-configuration)
+- [Split-Port Mode](#split-port-mode)
+- [Void Linux (xbps-src)](#void-linux-xbps-src-template)
+- [Uninstalling](#uninstalling)
+
+---
+
+## Install Methods
+
+### npm (recommended)
+
+```bash
+npm install -g omniroute
+omniroute
+```
+
+Dashboard opens at `http://localhost:20128` and API base URL is `http://localhost:20128/v1`.
+
+### pnpm
+
+```bash
+pnpm install -g omniroute
+pnpm approve-builds -g # Select all packages โ approve
+omniroute
+```
+
+> **pnpm users:** `pnpm approve-builds -g` is required to enable native build scripts for `better-sqlite3` and `@swc/core`.
+
+### Arch Linux (AUR)
+
+```bash
+yay -S omniroute-bin
+systemctl --user enable --now omniroute.service
+```
+
+The [AUR package](https://aur.archlinux.org/packages/omniroute-bin) installs OmniRoute and provides a systemd user service.
+
+### From Source
+
+```bash
+cp .env.example .env
+npm install
+PORT=20128 DASHBOARD_PORT=20129 NEXT_PUBLIC_BASE_URL=http://localhost:20129 npm run dev
+```
+
+### Docker
+
+See the [Docker Guide](DOCKER_GUIDE.md) for complete Docker setup including Compose profiles and Caddy HTTPS.
+
+### CLI Options
+
+| Command | Description |
+| ----------------------- | ----------------------------------------------------------- |
+| `omniroute` | Start server (`PORT=20128`, API and dashboard on same port) |
+| `omniroute --port 3000` | Set canonical/API port to 3000 |
+| `omniroute --mcp` | Start MCP server (stdio transport) |
+| `omniroute --no-open` | Don't auto-open browser |
+| `omniroute --help` | Show help |
+
+---
+
+## CLI Tool Configuration
+
+### 1) Connect Providers and Create API Key
+
+1. Open Dashboard โ `Providers` and connect at least one provider (OAuth or API key).
+2. Open Dashboard โ `Endpoints` and create an API key.
+3. (Optional) Open Dashboard โ `Combos` and set your fallback chain.
+
+### 2) Point Your Coding Tool
+
+```txt
+Base URL: http://localhost:20128/v1
+API Key: [copy from Endpoint page]
+Model: if/kimi-k2-thinking (or any provider/model prefix)
+```
+
+Works with Claude Code, Codex CLI, Gemini CLI, Cursor, Cline, OpenClaw, OpenCode, and OpenAI-compatible SDKs.
+
+For detailed per-tool configuration (Claude Code, Codex CLI, Cursor, Cline, OpenClaw, Kilo Code, Copilot, and more), see the dedicated **[CLI Tools Guide](CLI-TOOLS.md)**.
+
+---
+
+## Protocol Setup (MCP + A2A)
+
+### MCP Setup (Model Context Protocol)
+
+Start MCP transport in stdio mode:
+
+```bash
+omniroute --mcp
+```
+
+Recommended validation flow:
+
+```bash
+# 1. Start MCP server
+omniroute --mcp
+
+# 2. From your MCP client, call:
+omniroute_get_health # Should return system health
+omniroute_list_combos # Should return active combos
+
+# 3. Or run the full E2E suite:
+npm run test:protocols:e2e
+```
+
+#### MCP Client Configuration
+
+**Claude Code:**
+
+```bash
+claude mcp add-server omniroute --type http --url http://localhost:20128/api/mcp/stream
+```
+
+**Cursor / Cline:**
+
+Add to your MCP settings:
+
+```json
+{
+ "mcpServers": {
+ "omniroute": {
+ "command": "omniroute",
+ "args": ["--mcp"],
+ "env": {}
+ }
+ }
+}
+```
+
+**Full MCP documentation:** [MCP Server README](../open-sse/mcp-server/README.md) โ 29 tools, IDE configs, Python/TS/Go clients.
+
+### A2A Setup (Agent-to-Agent Protocol)
+
+Verify the Agent Card:
+
+```bash
+curl http://localhost:20128/.well-known/agent.json
+```
+
+Send a task:
+
+```bash
+curl -X POST http://localhost:20128/a2a \
+ -H 'content-type: application/json' \
+ -d '{"jsonrpc":"2.0","id":"quickstart","method":"message/send","params":{"skill":"quota-management","messages":[{"role":"user","content":"Give me a short quota summary."}]}}'
+```
+
+**Full A2A documentation:** [A2A Server README](../src/lib/a2a/README.md) โ JSON-RPC 2.0, skills, streaming, task lifecycle.
+
+---
+
+## Timeout Configuration
+
+### Basic Timeouts
+
+For most deployments, you only need these two variables:
+
+| Variable | Default | Purpose |
+| ------------------------ | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `REQUEST_TIMEOUT_MS` | `600000` | Shared baseline for upstream response-start timeout, hidden Undici timeouts, TLS fingerprint requests, and API bridge request/proxy timeouts |
+| `STREAM_IDLE_TIMEOUT_MS` | inherits `REQUEST_TIMEOUT_MS` | Maximum gap between streaming chunks before OmniRoute aborts the SSE stream |
+
+Backward compatibility is preserved: existing `FETCH_TIMEOUT_MS`, `API_BRIDGE_PROXY_TIMEOUT_MS`, and other per-layer timeout vars still work and override the shared baseline.
+
+### Provider-Specific Notes
+
+For Claude Code-compatible upstreams (`anthropic-compatible-cc-*`), OmniRoute derives the outbound `X-Stainless-Timeout` header from the resolved fetch timeout so provider-side read timeouts stay aligned with your env configuration.
+
+For third-party Claude Code-compatible reverse proxies, OmniRoute keeps the default `anthropic-beta` set conservative and, when `Client Cache Control` is left on `Auto`, only forwards client-provided `cache_control` markers.
+
+### Advanced Timeout Overrides
+
+| Variable | Default | Purpose |
+| ---------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------- |
+| `FETCH_TIMEOUT_MS` | inherits `REQUEST_TIMEOUT_MS` | Upstream response-start timeout used until response headers arrive |
+| `FETCH_HEADERS_TIMEOUT_MS` | inherits `FETCH_TIMEOUT_MS` | Undici time limit for receiving upstream response headers |
+| `FETCH_BODY_TIMEOUT_MS` | inherits `FETCH_TIMEOUT_MS` | Undici time limit between upstream body chunks (`0` disables it) |
+| `FETCH_CONNECT_TIMEOUT_MS` | `30000` | Undici TCP connect timeout |
+| `FETCH_KEEPALIVE_TIMEOUT_MS` | `4000` | Undici idle keep-alive socket timeout |
+| `TLS_CLIENT_TIMEOUT_MS` | inherits `FETCH_TIMEOUT_MS` | Timeout for TLS fingerprint requests made through `wreq-js` |
+| `API_BRIDGE_PROXY_TIMEOUT_MS` | inherits `REQUEST_TIMEOUT_MS` or `30000` | Timeout for `/v1` proxy forwarding from API port to dashboard port |
+| `API_BRIDGE_SERVER_REQUEST_TIMEOUT_MS` | `max(API_BRIDGE_PROXY_TIMEOUT_MS, 300000)` | Incoming request timeout on the API bridge server |
+| `API_BRIDGE_SERVER_HEADERS_TIMEOUT_MS` | `60000` | Incoming header timeout on the API bridge server |
+| `API_BRIDGE_SERVER_KEEPALIVE_TIMEOUT_MS` | `5000` | Keep-alive timeout on the API bridge server |
+| `API_BRIDGE_SERVER_SOCKET_TIMEOUT_MS` | `0` | Socket inactivity timeout on the API bridge server (`0` disables it) |
+
+> **Note:** For streaming requests, `FETCH_TIMEOUT_MS` only covers connection setup / waiting for the first upstream response. Once the stream is active, OmniRoute will only abort on an actual stall (`STREAM_IDLE_TIMEOUT_MS`) or Undici body inactivity (`FETCH_BODY_TIMEOUT_MS`).
+
+### Reverse Proxy Compatibility
+
+If you run OmniRoute behind Nginx, Caddy, Cloudflare, or another reverse proxy, make sure the proxy timeouts are also higher than your OmniRoute stream/fetch timeouts.
+
+---
+
+## Split-Port Mode
+
+Run API and Dashboard on separate ports for advanced scenarios (reverse proxy, container networking):
+
+```bash
+PORT=20128 DASHBOARD_PORT=20129 omniroute
+# API: http://localhost:20128/v1
+# Dashboard: http://localhost:20129
+```
+
+---
+
+## Void Linux (xbps-src) Template
+
+For Void Linux users, you can build a native package using `xbps-src`. Save this block as `srcpkgs/omniroute/template`:
+
+```bash
+# Template file for 'omniroute'
+pkgname=omniroute
+version=3.4.1
+revision=1
+hostmakedepends="nodejs python3 make"
+depends="openssl"
+short_desc="Universal AI gateway with smart routing for multiple LLM providers"
+maintainer="zenobit "
+license="MIT"
+homepage="https://github.com/diegosouzapw/OmniRoute"
+distfiles="https://github.com/diegosouzapw/OmniRoute/archive/refs/tags/v${version}.tar.gz"
+checksum=009400afee90a9f32599d8fe734145cfd84098140b7287990183dde45ae2245b
+system_accounts="_omniroute"
+omniroute_homedir="/var/lib/omniroute"
+export NODE_ENV=production
+export npm_config_engine_strict=false
+export npm_config_loglevel=error
+export npm_config_fund=false
+export npm_config_audit=false
+
+do_build() {
+ local _gyp_arch
+ case "$XBPS_TARGET_MACHINE" in
+ aarch64*) _gyp_arch=arm64 ;;
+ armv7*|armv6*) _gyp_arch=arm ;;
+ i686*) _gyp_arch=ia32 ;;
+ *) _gyp_arch=x64 ;;
+ esac
+
+ NODE_ENV=development npm ci --ignore-scripts
+ npm run build
+ cp -r .next/static .next/standalone/.next/static
+ [ -d public ] && cp -r public .next/standalone/public || true
+
+ local _node_gyp=/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
+ (cd node_modules/better-sqlite3 && node "$_node_gyp" rebuild --arch="$_gyp_arch")
+
+ local _bs3_release=.next/standalone/node_modules/better-sqlite3/build/Release
+ mkdir -p "$_bs3_release"
+ cp node_modules/better-sqlite3/build/Release/better_sqlite3.node "$_bs3_release/"
+
+ rm -rf .next/standalone/node_modules/@img
+
+ for _mod in pino-abstract-transport split2 process-warning; do
+ cp -r "node_modules/$_mod" .next/standalone/node_modules/
+ done
+}
+
+do_check() {
+ npm run test:unit
+}
+
+do_install() {
+ vmkdir usr/lib/omniroute/.next
+ vcopy .next/standalone/. usr/lib/omniroute/.next/standalone
+
+ for _d in \
+ .next/standalone/.next/server/app/dashboard \
+ .next/standalone/.next/server/app/dashboard/settings \
+ .next/standalone/.next/server/app/dashboard/providers; do
+ touch "${DESTDIR}/usr/lib/omniroute/${_d}/.keep"
+ done
+
+ cat > "${WRKDIR}/omniroute" <<'EOF'
+#!/bin/sh
+export PORT="${PORT:-20128}"
+export DATA_DIR="${DATA_DIR:-${XDG_DATA_HOME:-${HOME}/.local/share}/omniroute}"
+export APP_LOG_TO_FILE="${APP_LOG_TO_FILE:-false}"
+mkdir -p "${DATA_DIR}"
+exec node /usr/lib/omniroute/.next/standalone/server.js "$@"
+EOF
+ vbin "${WRKDIR}/omniroute"
+}
+
+post_install() {
+ vlicense LICENSE
+}
+```
+
+---
+
+## Uninstalling
+
+| Command | Action |
+| ------------------------ | ----------------------------------------------------------------------------------- |
+| `npm run uninstall` | Removes the system app but **keeps your DB and configurations** in `~/.omniroute`. |
+| `npm run uninstall:full` | Removes the app AND permanently **erases all configurations, keys, and databases**. |
+
+> For detailed uninstall instructions across all methods, see [UNINSTALL.md](UNINSTALL.md).