openrouter-upgrade-migration

Featured

Migrate to OpenRouter from direct provider APIs or upgrade between SDK/model versions. Triggers: 'openrouter migrate', 'openrouter upgrade', 'switch to openrouter', 'migrate from openai to openrouter'.

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# OpenRouter Upgrade & Migration ## Current State !`npm list openai 2>/dev/null | head -5` !`pip show openai 2>/dev/null | head -5` ## Overview Migrating to OpenRouter from a direct provider API (OpenAI, Anthropic) is minimal: change `base_url` and `api_key`, add two headers. The OpenAI SDK works natively with OpenRouter. This skill covers migrating from direct APIs, switching between models, upgrading SDK versions, and running comparison tests. ## Migration from Direct OpenAI ```python # BEFORE: Direct OpenAI from openai import OpenAI client = OpenAI(api_key=os.environ["OPENAI_API_KEY"]) response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello"}], max_tokens=200, ) # AFTER: Via OpenRouter (3 lines changed) from openai import OpenAI client = OpenAI( base_url="https://openrouter.ai/api/v1", # ← Changed api_key=os.environ["OPENROUTER_API_KEY"], # ← Changed default_headers={ # ← Added "HTTP-Referer": "https://my-app.com", "X-Title": "my-app", }, ) response = client.chat.completions.create( model="openai/gpt-4o", # ← Add provider prefix messages=[{"role": "user", "content": "Hello"}], max_tokens=200, ) ``` ## Migration from Direct Anthropic ```python # BEFORE: Direct Anthropic SDK import anthropic client = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"]) response = client.messages.create( model="claude-3-5-sonnet-2024...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

openrouter-openai-compat

Migrate from OpenAI to OpenRouter with minimal code changes. Use when switching to OpenRouter or maintaining dual compatibility. Triggers: 'openrouter openai compatible', 'openrouter drop-in', 'openai to openrouter', 'openrouter migration'.

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-migration-deep-dive

Migrate from OpenAI/GPT to Anthropic/Claude — API differences, Use when working with migration-deep-dive patterns. prompt adaptation, SDK swap, and feature mapping. Trigger with "migrate to claude", "openai to anthropic", "switch from gpt to claude", "replace openai with anthropic".

2,266 Updated today
jeremylongshore
AI & Automation Featured

groq-migration-deep-dive

Migrate from OpenAI/Anthropic/other LLM providers to Groq, or migrate between Groq model generations with zero-downtime traffic shifting. Trigger with phrases like "migrate to groq", "switch to groq", "groq migration", "openai to groq", "groq replatform".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-migration-deep-dive

Migrate to Claude API from OpenAI, Gemini, or other LLM providers. Use when switching from GPT-4 to Claude, migrating from Text Completions, or building a multi-provider abstraction layer. Trigger with phrases like "migrate to claude", "openai to anthropic", "switch from gpt to claude", "multi-provider llm".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-upgrade-migration

Upgrade Anthropic SDK versions and migrate between Claude API versions. Use when upgrading the Python/TypeScript SDK, migrating from Text Completions to Messages API, or adopting new API features like tool use or batches. Trigger with phrases like "upgrade anthropic sdk", "anthropic migration", "update claude sdk", "migrate to messages api".

2,266 Updated today
jeremylongshore