openrouter-agent-migration
Installation
SKILL.md
Migrating from @openrouter/sdk to @openrouter/agent
Agent functionality (callModel, tool(), stop conditions, format converters, streaming helpers) has moved from @openrouter/sdk to the standalone @openrouter/agent package. The @openrouter/agent package includes its own OpenRouter client class, so you do not need @openrouter/sdk for agent use cases.
When This Applies
Migrate if your code imports any of these from @openrouter/sdk:
callModelor usesclient.callModel()tool()factory function- Stop conditions:
stepCountIs,hasToolCall,maxCost,maxTokensUsed,finishReasonIs - Format converters:
fromClaudeMessages,toClaudeMessage,fromChatMessages,toChatMessage - Types:
Tool,ToolWithExecute,ToolWithGenerator,ManualTool,CallModelInput,ModelResult