mcpchannel.ai
MCP Servers & AgentsMCP ClientsSkillsCLI ToolsDocs
Menu

Explore

MCP Servers & AgentsBrowse listingsMCP ClientsSkillsCLI Tools+ List yours

Account

Log inSign up free
List yoursLog in
Mmcpchannel.aiBrowseAdvertiseAboutBlogContactPrivacyTerms
© 2026 mcpchannel.ai
← Back to CLI Tools

shihabshahrier/openrouter-free-infer

CLI

Details

openrouter-free — OpenRouter Free Model Integration for OpenCode

A production-ready skill that dynamically discovers and connects to free AI models via the OpenRouter API. Zero hardcoded model lists.

What It Does

  • Dynamically fetches all available models from GET https://openrouter.ai/api/v1/models
  • Auto-filters free models (tagged :free)
  • Detects capabilities (vision, tool-calling, structured outputs, reasoning) from API metadata
  • Caches locally at ~/.opencode/openrouter-model-cache.json with configurable TTL
  • Falls back gracefully if the API is unreachable or a model fails
  • Provides a clean CLI for model discovery, health checks, and interactive chat

Example Output

📋 Free Models (12 models)

ID                                    │ Name                                      │ Context │ Capabilities
──────────────────────────────────────┼───────────────────────────────────────────┼─────────┼────────────────────────
deepseek/deepseek-r1-0528:free        │ DeepSeek R1 (Free)                        │ 128K    │ 🧠 reasoning
google/gemma-3-27b-it:free            │ Gemma 3 27B Instruct (Free)               │ 128K    │ 👁️ vision 🔧 tool-calling
qwen/qwen3-32b:free                   │ Qwen3 32B (Free)                          │ 128K    │ 🔧 tool-calling 🧠 reasoning
meta-llama/llama-3.1-8b-instruct:free │ Llama 3.1 8B Instruct (Free)              │ 128K    │ 🔧 tool-calling
...

Install

Option 1: Automated (from repo root)

bash install.sh

Option 2: Manual — Claude Code

mkdir -p ~/.claude/skills/openrouter-free
cp -r skills/openrouter-free/. ~/.claude/skills/openrouter-free/
cd ~/.claude/skills/openrouter-free
npm install && npm run build

Option 3: Manual — Codex

mkdir -p ~/.agents/skills/openrouter-free
cp -r skills/openrouter-free/. ~/.agents/skills/openrouter-free/

Option 4: Manual — opencode

mkdir -p ~/.config/opencode/skills/openrouter-free
cp -r skills/openrouter-free/. ~/.config/opencode/skills/openrouter-free/

Usage

CommandDescription
openrouter-free initBootstrap — fetch models and populate cache
openrouter-free models freeList all free models
openrouter-free models codingFree models with tool-calling
openrouter-free models visionFree models with vision support
openrouter-free use r1Chat with DeepSeek R1 (alias)
openrouter-free use best-freeChat with auto-routed free model
openrouter-free chat "hello" --model qwenOne-shot message
openrouter-free refreshForce cache refresh
openrouter-free healthCheck all free models availability
openrouter-free aliasesList all known aliases
openrouter-free interactiveStart REPL chat mode

Requirements

  • Node.js ≥ 18
  • OPENROUTER_API_KEY environment variable
export OPENROUTER_API_KEY="sk-or-v1-your-key-here"
# Get a free key at: https://openrouter.ai/settings/keys

Architecture

cli.ts (entry) → OpenRouterFree (facade)
                  ├─ ModelRegistry   (API fetch + filter)
                  ├─ CacheManager    (disk persistence, TTL)
                  ├─ ProviderAdapter (chat completions, retry, stream)
                  ├─ FallbackRouter  (model selection + failover)
                  ├─ CapabilityDetector (infer from params)
                  ├─ HealthChecker   (ping probes)
                  └─ AliasManager    (short names → IDs)

Caching

  • Path: ~/.opencode/openrouter-model-cache.json
  • TTL: 1 hour (3,600,000 ms), override with CACHE_TTL_MS
  • Permissions: 0o600

Environment Variables

VariableDefaultDescription
OPENROUTER_API_KEY—API key (required)
OPENROUTER_BASE_URLhttps://openrouter.ai/api/v1Custom endpoint
CACHE_TTL_MS3600000Cache TTL in ms

License

MIT


📖 Project page: https://shihub.online/projects/openrouter-free-infer

View on GitHub →

Ratings & Reviews

No reviews yet. Be the first to rate this tool.

Sign in to leave a review.

Mmcpchannel.aiBrowseAdvertiseAboutBlogContactPrivacyTerms
© 2026 mcpchannel.ai
mcpchannel.ai
MCP Servers & AgentsMCP ClientsSkillsCLI ToolsDocs
Menu

Explore

MCP Servers & AgentsBrowse listingsMCP ClientsSkillsCLI Tools+ List yours

Account

Log inSign up free
List yoursLog in