A production-ready skill that dynamically discovers and connects to free AI models via the OpenRouter API. Zero hardcoded model lists.
GET https://openrouter.ai/api/v1/models:free)~/.opencode/openrouter-model-cache.json with configurable TTL📋 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
...
bash install.sh
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
mkdir -p ~/.agents/skills/openrouter-free
cp -r skills/openrouter-free/. ~/.agents/skills/openrouter-free/
mkdir -p ~/.config/opencode/skills/openrouter-free
cp -r skills/openrouter-free/. ~/.config/opencode/skills/openrouter-free/
| Command | Description |
|---|---|
openrouter-free init | Bootstrap — fetch models and populate cache |
openrouter-free models free | List all free models |
openrouter-free models coding | Free models with tool-calling |
openrouter-free models vision | Free models with vision support |
openrouter-free use r1 | Chat with DeepSeek R1 (alias) |
openrouter-free use best-free | Chat with auto-routed free model |
openrouter-free chat "hello" --model qwen | One-shot message |
openrouter-free refresh | Force cache refresh |
openrouter-free health | Check all free models availability |
openrouter-free aliases | List all known aliases |
openrouter-free interactive | Start REPL chat mode |
export OPENROUTER_API_KEY="sk-or-v1-your-key-here"
# Get a free key at: https://openrouter.ai/settings/keys
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)
~/.opencode/openrouter-model-cache.jsonCACHE_TTL_MS0o600| Variable | Default | Description |
|---|---|---|
OPENROUTER_API_KEY | — | API key (required) |
OPENROUTER_BASE_URL | https://openrouter.ai/api/v1 | Custom endpoint |
CACHE_TTL_MS | 3600000 | Cache TTL in ms |
MIT
📖 Project page: https://shihub.online/projects/openrouter-free-infer
No reviews yet. Be the first to rate this tool.
Sign in to leave a review.