9Router Install & 9Router Proxy Setup Guide: Windows & npm

📌 KEY TAKEAWAYSQuick Technical Reference
Target Protocol
OpenAI Compatible Gateway (Port 20128)
Core Install Methods
npm -g 9router & Docker (Windows/Linux)
Resilient Fallback Models
infer/qwen3.7-max, deepseek-chat
Enterprise Endpoint & Billing
PayPal & Global Cards ($0.20 Trial)
⚡ Quick Setup Generator
CLI & IDE One-Click Configurator

Select your coding tool and target model to generate instant, zero-login proxy configuration commands.

BASH
# Export APIVALE proxy base URL and API key
export ANTHROPIC_BASE_URL="https://apivale.com/v1"
export ANTHROPIC_API_KEY="sk-apivale-your-api-key"

# Launch Claude Code CLI with target model
claude --model infer/qwen3.7-max
Key Takeaways
  • 9Router Install: Complete your 9Router install via npm install -g 9router on Windows or Linux to start a local 9Router proxy on http://localhost:20128/v1.
  • 9Router Proxy Setup: Follow this 9Router install proxy setup guide to bind terminal agents and Cursor to port 20128 for multi-account pooling.
  • Bypassing 429 Errors: Eliminate upstream 429 rate limits and 503 gateway drops by pairing your 9Router proxy with reliable cloud endpoints.
  • Unthrottled Fallback: Connect APIVALE ($0.20 Free Credit) to route Qwen 3.7 Max and DeepSeek V4 with instant PayPal checkout.
Related Agent & Gateway Architecture Guides

Optimizing terminal workflows? Explore our OmniRoute Claude Code Setup Guide, evaluate cloud proxies in our 5 Best OpenRouter Alternatives Guide, configure custom base URLs in our Claude Code Custom Base URL Guide, or master IDE routing in our Qwen 3.8 Cursor Guide.

Developers performing a 9Router install (decolua/9router on GitHub) set up a local 9Router proxy on localhost:20128 to manage terminal coding agents like Claude Code, Cursor, and VSCode Cline. During intensive multi-file edits, direct API calls trigger upstream 429 rate limit exceptions, halting execution.

This 9Router install proxy setup guide demonstrates how to complete the 9Router install on Windows and npm, configure a resilient 9Router proxy, and route unthrottled fallbacks through APIVALE when upstream quotas expire.

Verify your target endpoint connectivity before configuring local daemons:

# Verify active connectivity to an unthrottled OpenAI/Anthropic gateway
curl -X POST https://apivale.com/v1/chat/completions \
  -H "Authorization: Bearer your_apivale_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "infer/qwen3.7-max",
    "messages": [{"role": "user", "content": "Verify unthrottled gateway."}],
    "max_tokens": 16
  }'
Primary-Source Community Voice

"9Router crashes with HTTP 503 and FreeUsageLimitError on step 4 of my Claude Code refactor. The auto-fallback to free community providers immediately throws 429 Too Many Requests because agent context trees exceed 45k tokens during grep loops."

Source: GitHub Issue Discussion (decolua/9router) View Community Thread →
Definition
9Router AI Proxy Gateway

9Router is an open-source local reverse proxy running on http://localhost:20128/v1. It normalizes OpenAI and Anthropic schemas, aggregates multiple API credentials, and applies RTK token compression to preserve coding agent workflows during provider rate limits.

9Router vs OpenRouter vs OmniRoute: Architecture Comparison

Comparing local daemons against cloud gateways clarifies when a 9Router install offers advantages over hosted aggregators:

Architecture Dimension9Router (Local Gateway)OpenRouter (Cloud Aggregator)OmniRoute (Local Daemon)APIVALE (Direct Cloud Gateway)
Deployment ModelLocal CLI (localhost:20128)Hosted Cloud APILocal CLI (localhost:20128)Global Anycast Cloud API
Primary AdvantageMulti-account token rotationBroad legacy model directoryLightweight Node loopbackUnthrottled Enterprise Concurrency
Objective Best ForMulti-account fallback & local RTKWeb playground & prototypingMinimal single-node scriptingZero-KYC, PayPal & 24/7 Agent Uptime
Supported ToolsClaude Code, Cursor, ClineAny OpenAI-compatible clientClaude Code, OpenCodeNative Anthropic & OpenAI Protocols
Failover Mechanism3-Tier (Subscription → Paid → Free)Manual client-side switching2-Tier upstream failoverAutomated Multi-Zone High Availability
Token OptimizationRTK & Caveman compressionPrompt compression filtersRTK token strippingZero-Fee Context Caching
Billing & KYCUpstream provider dependentStripe only (Card decline risk)Upstream provider dependentPayPal, Global Cards, Zero KYC ($0.20 Trial)

Note: Pricing and concurrency metrics verified via official documentation as of October 2026.

9Router Install Guide: npm, Windows PowerShell & Docker

Follow this section to execute your 9Router install and start the local 9Router proxy daemon on port 20128.

Method 1: Global npm Installation on Windows & macOS

Ensure Node.js (v18+) is available. Perform the global 9Router npm installation:

# Step 1: Execute 9Router install globally via npm
npm install -g 9router

# Step 2: Initialize configuration directory
mkdir -p "$HOME/.9router"

# Step 3: Launch 9Router proxy service on default port 20128
9router start --port 20128

For 9Router Windows execution policy issues in PowerShell, bypass script restrictions:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
9router

Method 2: Docker Containerized Deployment on Windows WSL2 & Linux

Docker provides a containerized 9Router install that isolates background runtime dependencies:

# Run 9Router container with persistent volume mounting
docker run -d \
  --name 9router-gateway \
  --restart unless-stopped \
  -p 20128:20128 \
  -v "$HOME/.9router:/app/data" \
  -e DATA_DIR=/app/data \
  decolua/9router:latest

Verify your local 9Router proxy health endpoint:

curl http://localhost:20128/health
# Expected JSON response: {"status":"healthy","uptime":42,"port":20128}

Configuring Coding Agents: Claude Code CLI, Cursor & VSCode Cline

Once your 9Router install is listening on port 20128, configure your coding assistants to route requests through the local proxy.

Step-by-Step 9Router Install Claude Code Binding

To set up 9Router install Claude Code integration, export the local base URL and virtual proxy token:

# Direct Claude Code to 9Router local proxy
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export ANTHROPIC_AUTH_TOKEN="local-9router-token"

# Launch Claude Code terminal agent
claude

The 9Router proxy intercepts Anthropic /v1/messages calls, applies RTK compression, and forwards requests to your configured upstream fallback.

Configuring 9Router VSCode and Cursor IDE

To configure 9Router VSCode and Cursor:

  1. Open Settings → Model Configuration → OpenAI API Key.
  2. Set Base URL to http://localhost:20128/v1.
  3. Set API key to your 9Router local token.
  4. Select your preferred fallback routing alias.

The Free Provider Trap: Fixing 429 Rate Limits & Intelligence Degradation

While the 9Router proxy enables multi-provider routing, agent performance depends on upstream quality.

Why Free Tier Fallback Fails on Heavy Agent Contexts (429 & 503)

Agent sessions generate substantial token volume. Reading directory structures and running git diffs passes 30,000 to 60,000 input tokens. Free community providers enforce restrictive Tokens-Per-Minute ceilings:

$$\text{TPM Ceiling} = 15,000 \text{ tokens/min} \quad \ll \quad \text{Agent Context Demand} \approx 50,000 \text{ tokens/turn}$$

When agents trigger tool use, free providers return HTTP 429 FreeUsageLimitError. 9Router surfaces this as an unhandled 503 Service Unavailable, interrupting execution.

The Intelligence Cliff: Why Low-Tier Fallback Breaks Codebases

When an agent drops from Claude Sonnet 5 to low-parameter models, reasoning collapses. Smaller models struggle with structured JSON schema output and dependency tracking.

To prevent broken code patches, this 9Router install proxy setup guide recommends routing fallback tiers to frontier coding models: Qwen 3.7 Max (infer/qwen3.7-max) and DeepSeek V4 (deepseek-chat).

Production Configuration: Routing 9Router to APIVALE High-Concurrency Endpoints

Configure APIVALE as your unthrottled fallback upstream in ~/.9router/config.json:

{
  "server": {
    "port": 20128,
    "host": "127.0.0.1",
    "timeoutMs": 120000
  },
  "providers": {
    "apivale_enterprise": {
      "baseURL": "https://apivale.com/v1",
      "apiKey": "sk-your-apivale-key",
      "models": [
        "infer/qwen3.7-max",
        "deepseek-chat",
        "infer/xiaomi-mimo-v2.6-pro"
      ],
      "maxRetries": 3,
      "timeoutMs": 60000
    }
  },
  "routes": {
    "coding_agent": {
      "strategy": "priority_fallback",
      "pipeline": [
        {
          "provider": "anthropic_direct",
          "model": "claude-3-5-sonnet-20241022"
        },
        {
          "provider": "apivale_enterprise",
          "model": "infer/qwen3.7-max"
        },
        {
          "provider": "apivale_enterprise",
          "model": "deepseek-chat"
        }
      ]
    }
  },
  "compression": {
    "rtkEnabled": true,
    "trimToolOutputs": true,
    "maxDiffLines": 500
  }
}

This configuration ensures that when Anthropic quotas deplete, your 9Router proxy transitions to APIVALE’s unthrottled Qwen 3.7 Max endpoint within 180ms.

Interactive Micro-Tool: 9Router Config & Failover Latency Simulator

Customize your 9Router install proxy setup guide parameters and test failover latency:

9Router Client Config & Fallback Simulator

Select your client tool and secondary model to generate ready-to-run 9Router parameters.

Ready
// Generated 9Router Environment Mapping
export ANTHROPIC_BASE_URL="http://localhost:20128/v1"
export 9ROUTER_UPSTREAM="https://apivale.com/v1"
export 9ROUTER_FALLBACK_MODEL="infer/qwen3.7-max"

Frequently Asked Questions: 9Router Setup & Troubleshooting

Q1: How do I resolve port 20128 conflicts on Windows?

Port collisions occur when a background instance of 9Router is running. Open PowerShell as Administrator and execute:

# Identify process holding port 20128
Get-Process -Id (Get-NetTCPConnection -LocalPort 20128).OwningProcess

# Terminate orphaned process
Stop-Process -Id (Get-NetTCPConnection -LocalPort 20128).OwningProcess -Force

After clearing port 20128, restart 9Router: 9router start --host 127.0.0.1 --port 20128.

Q2: Can 9Router route to Chinese flagship models like Qwen 3.7 Max without a +86 phone number?

Yes. Official Chinese domestic platforms require mainland phone verification and national identity KYC. By adding APIVALE (https://apivale.com/v1) as your upstream in 9Router, international developers access Qwen 3.7 Max, DeepSeek V4, and GLM-5.3 with zero KYC, paying via global PayPal or international credit cards.

Q3: How does RTK token pruning in 9Router compare to APIVALE context caching?

RTK operates on client machines by truncating repetitive terminal strings (git diff, grep output) before transmission. APIVALE context caching operates at the server infrastructure level, caching static prompt prefixes across turns. Combining 9Router RTK with APIVALE reduces effective agent token costs by over 75%.

Q4: How do I perform a clean 9Router uninstall on Windows or npm?

To complete a 9Router uninstall, terminate running background daemons on port 20128, remove the global package via npm uninstall -g 9router, and delete the configuration cache at $HOME/.9router (or %USERPROFILE%\.9router on Windows).

Route 9Router to Unthrottled Qwen 3.7 & DeepSeek V4

Eliminate 429 rate limit errors and prevent code quality degradation. Access OpenAI and Anthropic compatible endpoints with zero KYC, zero regional card declines, and instant PayPal global checkout. Claim your +50% first-deposit bonus or start with $0.20 free signup trial credit.

⚡ Instant Port 20128 Gateway Access
🎁 +50% First Deposit Bonus ($5 → $7.50)
🚀 $29 Pack: 40M Tokens (56% OFF)
💳 PayPal & Global Cards (0 Extra FX)
🎁 ZERO-CARD FREE TRIAL ACTIVE
⚡ Slash Coding Agent Token Costs by 80% with APIVALE

Zero credit card required. Register in 10s to claim 100,000 Free Tokens ($0.20) for instant testing in our Web Playground or via Cursor / Claude Code CLI. Test DeepSeek-V4.1, Qwen 3.8, and GLM-5.3 completely free before deciding to recharge!

⚡100,000 Free Starter Tokens (Zero Credit Card Required)
🧪Instant Online & CLI Testing (DeepSeek / Qwen / GLM)
🎁+50% First Deposit Bonus (Deposit $5 → Get $7.50 When Ready)
💳PayPal & Global Cards (Instant 0s Activation, Zero KYC)
✓ Zero KYC • No forced payments • Tokens never expire • Start testing 100% free
Alex Rivera
About Alex Rivera

Alex Rivera specializes in distributed API gateway architectures, high-concurrency LLM routing, and multi-provider failover systems.