openrouter-upgrade-migration
Skill by jeremylongshore
Guides migration from direct OpenAI or Anthropic API calls to OpenRouter, or an upgrade between SDK and model versions. Aimed at developers who want a gradual switch with comparison tests and a feature flag.
Install openrouter-upgrade-migration
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-upgrade-migration ~/.claude/skills/openrouter-upgrade-migrationRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install openrouter-upgrade-migration 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-upgrade-migration ~/.gemini/antigravity-cli/skills/openrouter-upgrade-migrationAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install openrouter-upgrade-migration in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
The openrouter-upgrade-migration skill guides a move from direct OpenAI or Anthropic API calls to OpenRouter, or an upgrade between SDK and model versions. According to the source, the core change is small: set base_url to https://openrouter.ai/api/v1, switch to the OPENROUTER_API_KEY variable, add the HTTP-Referer and X-Title headers, and prefix model IDs with their provider. Anthropic users also change response parsing to the OpenAI format.
The skill includes a model ID migration map, a migration checklist covering config, code, testing and operations, and a comparison test script that runs the same prompt against old and new configurations. It also shows a feature flag pattern that moves traffic from 10% to 50% to 100%. It is aimed at developers who already use the OpenAI or Anthropic SDK and want to move to OpenRouter in a controlled way.
Written from the project's SKILL.md and checked against it.
What it can do
- Migrate from direct OpenAIShows the before and after code for changing base_url, API key and headers.
- Migrate from direct AnthropicShows how to move Anthropic SDK calls to the OpenAI SDK through OpenRouter.
- TypeScript migrationShows the equivalent client setup for the OpenAI SDK in TypeScript.
- Model ID migration mapLists direct provider model IDs and their OpenRouter equivalents.
- Comparison test scriptRuns one prompt through old and new setups and reports model, tokens and latency.
- Feature flag migrationUses a USE_OPENROUTER environment variable to switch backends gradually.
- Migration checklistLists config, code, testing and operations items to finish before cutover.
What you need
- OpenRouter API key (sk-or-v1-...)
- An existing OpenAI or Anthropic integration
- Python 3.8+ or Node.js 18+
- OpenAI SDK
Try asking
- Migrate my OpenAI client calls in this project to OpenRouter
- Convert my Anthropic SDK code to use OpenRouter with the OpenAI SDK
- Compare gpt-4o and openai/gpt-4o responses on the same prompt
Good to know
- Anthropic SDK users must switch to the OpenAI SDK during migration.
- The source states an expected added latency of about 50-100ms.
- Designed for Claude Code.
Security check
B- Allowed to use Write, Edit without limitsIn
SKILL.md
Checked automatically: skills/.curated/openrouter-upgrade-migration/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(node:*)Bash(npm:*)Bash(pip:*)
Alternatives to openrouter-upgrade-migration
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-upgrade-migration: common questions
Do I need to change my SDK when migrating to OpenRouter?
The source says the OpenAI SDK works natively with OpenRouter. Anthropic SDK users switch to the OpenAI SDK as part of the migration.
Can I roll out the migration gradually?
Yes. The source describes a feature flag using the USE_OPENROUTER environment variable, with traffic moved 10%, then 50%, then 100%.
What causes a 401 error after migrating?
The source says this usually happens when an old provider API key is used with the new OpenRouter base_url. Update to an OpenRouter key starting with sk-or-v1-.
How do I install openrouter-upgrade-migration?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is openrouter-upgrade-migration free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is openrouter-upgrade-migration 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-upgrade-migration?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
