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.
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-configRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install openrouter-fallback-config in Claude Code
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/openrouter-fallback-config ~/.gemini/antigravity-cli/skills/openrouter-fallback-configAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install openrouter-fallback-config in Antigravity CLI
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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
