Skip to main content
skill CX Codex

openrouter-agent-migration — Claude Code skill: move agent code

Walks you through switching agent imports from @openrouter/sdk to the @openrouter/agent package.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add OpenRouterTeam/skills --skill openrouter-agent-migration -a claude-code
Open on GitHub

What openrouter-agent-migration does

Reach for this skill when your code pulls callModel, the tool() factory or stop conditions such as stepCountIs and hasToolCall out of @openrouter/sdk. Agent features now ship in a separate package, @openrouter/agent, and the skill maps the move.

It carries import mapping tables: the client and callModel, tool creation, stop conditions, format converters, types and type guards. A before-and-after example makes the scope clear — only the import lines change, the call itself stays as it was. The OpenRouter client class now lives in the new package, so agent-only projects can drop the old one.

Keep @openrouter/sdk around if you also call the models list, chat completions, credits, OAuth or API key endpoints. Uninstalling it breaks those calls. The standalone callModel function needs an OpenRouterCore instance from @openrouter/sdk/core; without one that path fails.

What it helps with

  • move agent imports onto the new package
  • swap the old OpenRouter client import
  • fix paths for stop conditions and format converters
  • decide when both packages stay in dependencies
  • update tool types and type guards

Example prompts for the agent

  • Migrate my agent code from @openrouter/sdk to @openrouter/agent
  • Where do tool() and stepCountIs come from now?
  • Show me the import changes for callModel

How to install openrouter-agent-migration

1Skills CLI (Vercel)

npx skills add OpenRouterTeam/skills --skill openrouter-agent-migration -a claude-code

2Manually: put the files in place

~/.claude/skills/openrouter-agent-migration/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/openrouter-agent-migration/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about openrouter-agent-migration

How do I install openrouter-agent-migration in Claude Code?

Run npx skills add OpenRouterTeam/skills --skill openrouter-agent-migration -a claude-code. The skill lands at ~/.claude/skills/openrouter-agent-migration/SKILL.md.

What does openrouter-agent-migration do?

It documents the move from @openrouter/sdk to @openrouter/agent, covering imports for callModel, tool(), stop conditions, converters and types.

Do I still need @openrouter/sdk?

Yes, if you use non-agent features. Model listing, chat completions, credits, OAuth and API keys stay in that package, so both are required.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set8

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor