Use this skill whenever the user wants to work with OpenRouter's free LLM models. Triggers include: any mention of "OpenRouter", "free models", "openrouter-connect", routing queries through a free LLM, writing code to call OpenRouter, or picking/testing an OpenRouter model. Also use when the user wants to proxy a question to a free model, compare free model outputs, or scaffold code (Python or JS/TS) that calls OpenRouter. Always use this skill when OpenRouter or free-tier LLM routing is involved.
This calls GET https://openrouter.ai/api/v1/models (no auth required) and filters
for models where bothpricing.prompt == "0" and pricing.completion == "0".
The script outputs a JSON array ranked by the default preference list (see
references/model_preferences.md for how ranking works and how to customise it).
Pass --refresh to bypass the 1-hour local cache.
Step 2 — Select a model (ranked fallback chain)
Read references/model_preferences.md for the full preference system.
Quick summary:
The user's explicit ranked list is tried first (index 0 = highest priority)
If a listed model isn't free right now, it's skipped
If no listed model is available, fall back to the auto-ranked free pool
Stream the response back to the user and note which model was used.
If the model returns a 429 (rate limit) or 5xx, automatically retry with the next
model in the ranked list. Log which model was tried and why it was skipped.