mcpField
9
9router

9router

github.com/decoluaDevelopment31.6k214 installsUpdated today
Repository

About 9router

9router is a skill for using a local or remote AI gateway through an OpenAI-compatible REST API. It helps route requests across providers, discover available model capabilities, and use fallback combinations.

Key features

  1. 01OpenAI-compatible REST requests
  2. 02Model discovery across capabilities
  3. 03Provider combinations with auto-fallback
  4. 04Chat, image, speech, embedding, and web skills

Use cases

  1. 01Finding a model ID for a capability
  2. 02Routing requests through a configured gateway
  3. 03Using a fallback combination when a provider is unavailable

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/decolua/9router --skill 9router

After installing, type/9routerin Claude Code to confirm it loaded.

Details

From the project README

9Router

Local/remote AI gateway exposing OpenAI-compatible REST. One key, many providers, auto-fallback.

Setup

export NINEROUTER_URL="http://localhost:20128"      # or VPS / tunnel URL
export NINEROUTER_KEY="sk-..."                      # from Dashboard → Keys (only if requireApiKey=true)

All requests: ${NINEROUTER_URL}/v1/... with header Authorization: Bearer ${NINEROUTER_KEY} (omit if auth disabled).

Verify: curl $NINEROUTER_URL/api/health → {"ok":true}

Discover models

curl $NINEROUTER_URL/v1/models                  # chat/LLM (default)
curl $NINEROUTER_URL/v1/models/image            # image-gen
curl $NINEROUTER_URL/v1/models/tts              # text-to-speech
curl $NINEROUTER_URL/v1/models/embedding        # embeddings
curl $NINEROUTER_URL/v1/models/web              # web search + fetch (entries have `kind` field)
curl $NINEROUTER_URL/v1/models/stt              # speech-to-text
curl $NINEROUTER_URL/v1/models/image-to-text    # vision

Use data[].id as model field in requests. Combos appear with owned_by:"combo".

Response shape:

{ "object": "list", "data": [
  { "id": "openai/gpt-5", "object": "model", "owned_by": "openai", "created": 1735000000 },
  { "id": "tavily/search", "object": "model", "kind": "webSearch", "owned_by": "tavily", "created": 1735000000 }
]}

Capability skills

When the user needs a specific capability, fetch that skill's SKILL.md from its raw URL:

CapabilityRaw URL
Chat / code-genhttps://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router-chat/SKILL.md
Image generationhttps://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router-image/SKILL.md
Text-to-speechhttps://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router-tts/SKILL.md
Speech-to-texthttps://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router-stt/SKILL.md
Embeddingshttps://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router-embeddings/SKILL.md
Web searchhttps://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router-web-search/SKILL.md
Web fetch (URL → markdown)https://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router-web-fetch/SKILL.md

Errors

  • 401 → set/refresh NINEROUTER_KEY (Dashboard → Keys)
  • 400 Invalid model format → check model exists in /v1/models/<kind>
  • 503 All accounts unavailable → wait retry-after or add another provider account

Comments

Markdown supported