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-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.

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

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-migration

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

Step-by-step: install openrouter-upgrade-migration in Claude Code

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 →

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.

openrouter-upgrade-migration Install

Add to stack

Loading.