Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

router4

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

router4

Endpoint proxy server with web dashboard

latest
npmnpm
Version
0.2.13
Version published
Maintainers
1
Created
Source

🚀 ROUTER4

npm version License

AI endpoint proxy with web dashboard - A JavaScript port of CLIProxyAPI.

Router4 Dashboard

📖 Introduction

Router4 is a powerful AI API proxy server that provides unified access to multiple AI providers through a single endpoint. It features automatic format translation, intelligent fallback routing, OAuth authentication, and a modern web dashboard for easy management.

Key Highlights:

  • JavaScript Port: Converted from CLIProxyAPI (Go) to JavaScript/Node.js for better accessibility and easier deployment
  • Universal CLI Support: Works seamlessly with Claude Code, OpenAI Codex, Cline, RooCode, AmpCode, and other CLI tools
  • Cross-Platform: Runs on Windows, Linux, and macOS
  • Easy Deployment: Simple installation via npx, or deploy to VPS

✨ Features

Core Features

  • 🔄 Multi-Provider Support: Unified endpoint for 15+ AI providers (Claude, OpenAI, Gemini, GitHub Copilot, Qwen, iFlow, DeepSeek, Kimi, MiniMax, GLM, etc.)
  • 🔐 OAuth & API Key Authentication: Supports both OAuth2 flow and API key authentication
  • 🎯 Format Translation: Automatic request/response translation between OpenAI, Claude, Gemini, Codex, and Ollama formats
  • 🌐 Web Dashboard: Beautiful React-based dashboard for managing providers, combos, API keys, and settings
  • 📊 Usage Tracking: Real-time monitoring and analytics for all API requests

Advanced Features

  • 🎲 Combo System: Create model combos with automatic fallback support
  • ♻️ Intelligent Fallback: Automatic account rotation when rate limits or errors occur
  • ⚡ Response Caching: Optimized caching for Claude Code (1-hour cache vs default 5 minutes)
  • 🔧 Model Aliases: Create custom model aliases for easier management
  • 🔍 WebSearch Hook: Model-based web search integration for Claude Code CLI
  • ☁️ Cloud Deployment: Deploy to Cloud for Cursor IDE integration with global edge performance

Format Support

  • OpenAI Format: Standard OpenAI Chat Completions API
  • Claude Format: Anthropic Messages API
  • Gemini Format: Google Generative AI API
  • OpenAI Responses API: Codex CLI format
  • Ollama Format: Compatible with Ollama-based tools

CLI Integration

  • Works with: Claude Code, OpenAI Codex, Cline, RooCode, AmpCode, Cursor, and more
  • Seamless integration with popular AI coding assistants
  • WebSearch hook for enhanced Claude Code capabilities

📦 Install

# Run directly with npx (recommended)
npx router4

# Or install globally
npm install -g router4
router4

🚀 Quick Start

router4                    # Start server with default settings
router4 --port 8080        # Custom port
router4 --no-browser       # Don't open browser
router4 --skip-update      # Skip auto-update check
router4 --help             # Show help

Dashboard: http://localhost:20128/dashboard

💾 Data Location

User data stored at:

  • macOS/Linux: ~/.router4/db.json
  • Windows: %APPDATA%/router4/db.json

🛠️ Development

Setup

# Clone repository
git clone https://github.com/yourusername/router4.git
cd router4

# Install dependencies
npm install

# Start development server
npm run dev

Project Structure

router4/
├── bin/                    # CLI entry point
│   ├── cli.js             # Main CLI script
│   └── hooks/             # CLI hooks (WebSearch)
├── src/
│   ├── app/               # Next.js app (dashboard & API routes)
│   ├── lib/               # Core libraries (DB, OAuth, etc.)
│   ├── shared/            # Shared components & utilities
│   └── sse/               # SSE streaming handlers
├── open-sse/              # Core proxy engine (translator, handlers)
│   ├── translator/        # Format translators
│   ├── handlers/          # Request handlers
│   ├── services/          # Core services
│   └── config/            # Provider configurations
└── public/                # Static assets

📤 Build & Publish

# Build standalone binary
npm run build:standalone

# Test locally
npm link
router4 --help

# Publish to npm
npm login
npm publish

🧰 Tech Stack

LayerTechnology
RuntimeNode.js 20+ / Bun
FrameworkNext.js 15
DashboardReact 19 + Tailwind CSS 4
DatabaseLowDB (JSON file-based)
CLINode.js CLI with auto-update
StreamingServer-Sent Events (SSE)
AuthOAuth 2.0 (PKCE) + API Keys
DeploymentStandalone / VPS
State ManagementZustand

Core Libraries

  • lowdb: Lightweight JSON database
  • undici: High-performance HTTP client
  • uuid: Unique identifier generation
  • node-machine-id: Machine identification for cloud sync
  • open: Cross-platform browser launcher

🙏 Acknowledgments

Special thanks to:

  • CLIProxyAPI: The original Go implementation that inspired this project. Router4 is a JavaScript port with enhanced features and web dashboard.
  • ccs: Reference implementation for WebSearch hook integration in Claude Code CLI.

📄 License

MIT License - see LICENSE for details.

FAQs

Package last updated on 02 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts