Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

openrouter-fallback-config

Skill by jeremylongshore

Configures automatic model fallbacks on OpenRouter for high availability. It covers native model fallback, provider ordering, client-side chains and capability-matched model lists. Built for developers whose systems must survive provider outages.

  • Score 76
  • 3k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install openrouter-fallback-config

Built from the published package, never by AI.

git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/openrouter-fallback-config ~/.claude/skills/openrouter-fallback-config

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install openrouter-fallback-config in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill configures automatic model fallbacks on OpenRouter so an AI application keeps working when a provider or model fails. It covers OpenRouter's native fallback, which takes a models array with route set to fallback and tries each model in order. It also covers provider fallback using provider.order and allow_fallbacks, a client-side chain that walks primary, secondary, budget and last-resort models with per-model timeouts, and capability-based chains for tool calling, vision, long context and budget work.

The skill also includes a curl test that sends an invalid primary model and checks that the response comes from openai/gpt-4o-mini. It is aimed at developers building resilient systems that must survive provider outages. Setup needs an OpenRouter API key, and the fallback patterns need Python 3.8+ with the OpenAI SDK.

Written from the project's SKILL.md and checked against it.

What it can do

  • Native model fallbackPasses a models array with route set to fallback so OpenRouter tries each model in order.
  • Provider fallbackRoutes one model through a priority list of providers using provider.order and allow_fallbacks.
  • Client-side fallback chainresilient_completion() walks a chain with per-model timeouts and raises when every entry fails.
  • Capability matchingCAPABILITY_CHAINS lists fallback models for tool calling, vision, long context and budget work.
  • Served-model loggingLogs response.model so you can see whether a fallback fired for a request.
  • Fallback testingProvides a curl test with an invalid primary model to confirm the fallback works.

What you need

  • OpenRouter API key exported as OPENROUTER_API_KEY
  • Python 3.8+ with the OpenAI SDK
  • curl and jq for the testing step

Try asking

  • Set up a fallback chain for my OpenRouter calls with gpt-4o as the backup.
  • Check which model served my last OpenRouter request using response.model.
  • Show me how to route Claude through Anthropic first, then AWS Bedrock.

Good to know

  • capability_fallback() passes no capability chain to resilient_completion(), which always uses FALLBACK_CHAIN.
  • Sequential timeouts can cause a slow cascade, so the source suggests 10-15s per model.
  • Fallback models must support the features your prompt uses, or responses may be inconsistent.

Security check

B
  • Allowed to use Write, Edit without limitsIn SKILL.md

Checked automatically: skills/.curated/openrouter-fallback-config/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: ReadWriteEditGrepBash(python3:*)Bash(curl:*)Bash(jq:*)

Alternatives to openrouter-fallback-config

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

openrouter-fallback-config: common questions

How do I tell which model answered a request?

Check the model field on the response. The source says it shows the model that actually served the request, which reveals when a fallback fired.

What happens when every fallback fails?

resilient_completion() raises RuntimeError with the message 'All fallbacks exhausted', which the source describes as the signal to alert on.

What are the two main ways to set up fallbacks?

Server-side fallback uses a models array with route set to fallback. Client-side fallback uses a Python chain with per-model timeouts and custom error handling.

How do I install openrouter-fallback-config?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is openrouter-fallback-config free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is openrouter-fallback-config safe to use?

It scores 76 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.

What are alternatives to openrouter-fallback-config?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

openrouter-fallback-config Install

Add to stack

Loading.