Skip to main content
ClaudeWave
EN, English
decolua / Subagents

9router

Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits.

  • 31.3k stars
  • 6k forks
  • 2,683 open issues
  • Language: JavaScript
  • License: MIT
  • updated

Install

Terminal
git clone https://github.com/decolua/9router && cp 9router/*.md ~/.claude/agents/
  1. Clone the repository and copy the agent .md definitions into ~/.claude/agents (or .claude/agents inside a project).
  2. Start a new Claude Code session to load the agents.
  3. Delegate work to them with the Task/Agent tool or by name.

Editor's note

9Router is a locally hosted AI gateway written in JavaScript that runs at `localhost:20128` and exposes an OpenAI-compatible `/v1` endpoint, letting coding tools such as Claude Code, Cursor, Cline, Codex, and GitHub Copilot route requests through more than 40 model providers including free tiers from Kiro AI and OpenCode, cheap options like GLM and MiniMax, and paid subscriptions. The router translates between OpenAI and Claude message formats automatically, so tools that expect one API shape can reach providers that speak the other. Its RTK Token Saver feature compresses `tool_result` content, trimming 20 to 40 percent of tokens per request, which is particularly relevant when tool outputs like `git diff` or directory listings are passed back to the model. A three-tier auto-fallback chain moves traffic from subscription quotas to cheap providers and then to free providers without manual intervention, and a round-robin multi-account mode spreads load across multiple credentials for a single provider. Developers who want to reduce API spending or avoid mid-session rate limits are the primary audience, and the project ships as an npm package, a Docker image, or a self-hosted Next.js application.

Installable items

9 items in this repository

9routerSkill

Entry point for 9Router — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, embeddings, web search, web fetch. Use when the user mentions 9Router, NINEROUTER_URL, or wants AI without writing provider boilerplate. This skill covers setup + indexes capability skills; fetch the relevant capability SKILL.md from the URLs below when needed.

Install

Chat / code generation via 9Router using OpenAI /v1/chat/completions or Anthropic /v1/messages format with streaming + auto-fallback combos. Use when the user wants to ask an LLM, generate code, summarize text, or run prompts through 9Router.

Install

Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.

Install

Generate images via 9Router /v1/images/generations using OpenAI / Gemini Imagen / DALL-E / FLUX / MiniMax / SDWebUI / ComfyUI / Codex models. Use when the user wants to create, generate, draw, or render an image, picture, or text-to-image (txt2img).

Install

Speech-to-text via 9Router /v1/audio/transcriptions using OpenAI Whisper / Groq / Gemini / Deepgram / AssemblyAI / NVIDIA / HuggingFace models. Use when the user wants to transcribe audio, convert speech to text, or get subtitles from audio files.

Install

Text-to-speech via 9Router /v1/audio/speech using OpenAI / ElevenLabs / Deepgram / Edge TTS / Google TTS / Hyperbolic / Inworld voices. Use when the user wants to convert text to speech, generate audio, voiceover, narrate, or read text aloud.

Install

Generate videos via 9Router /v1/videos/generations using xAI Grok Imagine (grok-imagine-video). Async job flow - submit, poll request_id until done, download MP4. Use when the user wants to create, generate, or render a video, text-to-video (txt2vid), or image-to-video.

Install

Fetch URL → markdown / text / HTML via 9Router /v1/web/fetch using Firecrawl / Jina Reader / Tavily Extract / Exa Contents. Use when the user wants to scrape a webpage, extract URL content, read article, or convert a URL to markdown.

Install

Web and X search via 9Router /v1/search using Tavily / Exa / Brave / Serper / SearXNG / Google PSE / Linkup / SearchAPI / You.com / Perplexity / Xquik. Use when the user wants to search the web, find articles, or search public X posts.

Install
README

Subagents overview

Full README on GitHub

9Router - FREE AI Router & Token Saver

Never stop coding. Save 20-40% tokens with RTK + auto-fallback to FREE & cheap AI models.

Connect All AI Code Tools (Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini, OpenCode, Cline, OpenClaw...) to 40+ AI Providers & 100+ Models.

npm Downloads Docker Pulls GHCR License

🚀 Quick Start • 💡 Features • 📖 Setup • 🌐 Website

🇧🇷 Português (Brasil) • 🇻🇳 Tiếng Việt • 🇨🇳 中文 • 🇯🇵 日本語 • 🇷🇺 Русский • 🇹🇭 ไทย • 🇮🇷 فارسی • 🇮🇩 Indonesia • 🇪🇸 Español • 🇫🇷 Français


🤔 Why 9Router?

Stop wasting money, tokens and hitting limits:

  • ❌ Subscription quota expires unused every month

  • ❌ Rate limits stop you mid-coding

  • ❌ Tool outputs (git diff, grep, ls...) burn tokens fast

  • ❌ Expensive APIs ($20-50/month per provider)

  • ❌ Manual switching between providers

9Router solves this:

  • ✅ RTK Token Saver - Auto-compress tool_result content, save 20-40% tokens per request

  • ✅ Maximize subscriptions - Track quota, use every bit before reset

  • ✅ Auto fallback - Subscription → Cheap → Free, zero downtime

  • ✅ Multi-account - Round-robin between accounts per provider

  • ✅ Universal - Works with Claude Code, Codex, Cursor, Cline, any CLI tool


🔄 How It Works

┌─────────────┐
│  Your CLI   │  (Claude Code, Codex, OpenClaw, Cursor, Cline...)
│   Tool      │
└──────┬──────┘
       │ http://localhost:20128/v1
       ↓
┌─────────────────────────────────────────────┐
│           9Router (Smart Router)            │
│  • RTK Token Saver (cut tool_result tokens) │
│  • Format translation (OpenAI ↔ Claude)     │
│  • Quota tracking                           │
│  • Auto token refresh                       │
└──────┬──────────────────────────────────────┘
       │
       ├─→ [Tier 1: SUBSCRIPTION] Claude Code, Codex, GitHub Copilot
       │   ↓ quota exhausted
       ├─→ [Tier 2: CHEAP] GLM ($0.6/1M), MiniMax ($0.2/1M)
       │   ↓ budget limit
       └─→ [Tier 3: FREE] Kiro, OpenCode Free, Vertex ($300 credits)

Result: Never stop coding, minimal cost + 20-40% token savings via RTK

⚡ Quick Start

1. Install globally:

npm install -g 9router
9router

🎉 Dashboard opens at http://localhost:20128

2. Connect a FREE provider (no signup needed):

Dashboard → Providers → Connect Kiro AI (~50 credits/month free: Claude 4.5 + GLM-5 + MiniMax) or OpenCode Free (no auth) → Done!

3. Use in your CLI tool:

Claude Code/Codex/OpenClaw/Cursor/Cline Settings:
  Endpoint: http://localhost:20128/v1
  API Key: [copy from dashboard]
  Model: kr/claude-sonnet-4.5

That's it! Start coding with FREE AI models.

Alternative: run from source (this repository):

This repository package is private (9router-app), so source/Docker execution is the expected local development path.

cp .env.example .env
npm install
PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev

Production mode:

# Create Temporary Memory For Build
sudo fallocate -l 2G /swapfile_temp
sudo chmod 600 /swapfile_temp
sudo mkswap /swapfile_temp
sudo swapon /swapfile_temp

export MAKEFLAGS="-j1"
export DLIB_NO_GUI_SUPPORT=1
export CFLAGS="-mno-avx"

npm run build

# Clear temporary swap
sudo swapoff /swapfile_temp
sudo rm /swapfile_temp

PORT=20128 HOSTNAME=0.0.0.0 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run start

Default URLs:

  • Dashboard: http://localhost:20128/dashboard

  • OpenAI-compatible API: http://localhost:20128/v1


Video Guides

🇻🇳 Tiếng Việt Tiết kiệm chi phí LLM cho OpenClaw với 9Routerby Mì AI 🇵🇰 اردو / हिन्दी 9Router + Claude Code FREE Unlimited Setupby Build AI With Hamid 🇺🇸 English 9Router + Claude Code FREE Setupby Build AI With Hamid 🇺🇸 English 9Router + Claude Code FREE Setupby Build AI With Hamid 🇺🇸 English Claude Code FREE Forever — Unlimited Modelsby Build AI With Hamid 🇺🇸 English Claude CLI Free Setup with 9Router 🚀by CodeVerse Soban 🇻🇳 Tiếng Việt Cài Đặt OpenClaw Free Từ A-Z + 9Routerby Mai Gia 🇺🇸 English FREE OpenClaw + Claude Opus 4.6by Build AI With Hamid 🇮🇩 Indonesia Koding 24 Jam Anti Rate Limit! Hemat Token AI 65% | Tutorial Quick Setup 9Router 🚀by Krisswuh 🇮🇩 Indonesia Cara Deploy 9Router di Hugging Face GRATIS Non-Stop! | Alternatif VPS RAM 16GBby Krisswuh 🇮🇷 Persian-فارسی این شکلی از هر API ای استفاده کن برای هوش مصنوعیby Matin SenPai 🇻🇳 Tiếng Việt Hướng Dẫn Setup OpenClaw + 9Router: Tạo Bot Zalo AI Tự Động Từ A-Zby tuanminhhole

Topics
ai-agentsai-gatewayanthropicchatgptclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminigemini-clillmllm-gatewayopenaiopenai-proxyqwentoken-saver
Frequently asked

What people ask about 9router

What is decolua/9router?

decolua/9router is subagents for the Claude AI ecosystem. Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor, Cline, Copilot, Antigravity to FREE Claude/GPT/Gemini via 40+ providers. Auto-fallback, RTK -40% tokens, never hit limits. It has 31.3k GitHub stars and its last recorded update is dated 2026-10-23.

How do I install 9router?

You can install 9router by cloning the repository (https://github.com/decolua/9router) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.

Is decolua/9router safe to use?

Our security agent has analyzed decolua/9router and assigned a Trust Score of 100/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.

Who maintains decolua/9router?

decolua/9router is maintained by decolua. The last recorded GitHub activity is dated 2026-10-23, with 2683 open issues.

Are there alternatives to 9router?

Yes. On ClaudeWave you can browse similar subagents at /categories/agents, sorted by popularity or recent activity.

Maintain this repo? Show its Trust Score in your README

The badge shows this repository's current Trust Score and verdict, and links back to this page. It follows the catalogue data: nobody can buy or edit the score it displays.

ClaudeWave Trust Score for decolua/9router
Markdown (README)
[![ClaudeWave Trust Score for decolua/9router](https://claudewave.com/api/badge/decolua-9router)](https://claudewave.com/en/repo/decolua-9router)
HTML
<a href="https://claudewave.com/en/repo/decolua-9router"><img src="https://claudewave.com/api/badge/decolua-9router" alt="ClaudeWave Trust Score for decolua/9router" width="320" height="64"></a>

What the badge means and how the score is computed

Alternatives

See all
Project homepage
https://9router.com