openrouter-agent-migration

Migrate TypeScript agent imports from @openrouter/sdk to @openrouter/agent.

209|33|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/OpenRouterTeam/skills --skill openrouter-agent-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openrouter-agent-migration
Source: https://github.com/OpenRouterTeam/skills/tree/main/skills/openrouter-agent-migration
Command: npx skills add https://github.com/OpenRouterTeam/skills --skill openrouter-agent-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating agent functionality from the legacy @openrouter/sdk package to the standalone @openrouter/agent package requires updating dozens of import paths, package references, and type imports, which is time-consuming and prone to manual errors for TypeScript developers.

Core Features & Use Cases

  • Complete Import Mapping: Provides exact before/after import paths for all agent-related exports including callModel, tool(), stop conditions, format converters, and type definitions.
  • Mixed Project Support: Includes guidance for codebases that use both @openrouter/sdk for non-agent features (model listing, credits, OAuth) and @openrouter/agent for agent functionality.
  • New Feature Coverage: Documents agent-only capabilities like shared context schemas, tool approval flows, and turn lifecycle callbacks that are not available in the legacy SDK. Use case: A development team maintaining an OpenRouter-powered agent in TypeScript can use this skill to quickly update their codebase after the agent functionality was split into a separate package, avoiding broken imports and missing features.

Quick Start

Use this skill to update all your @openrouter/sdk agent-related imports and package references to the new @openrouter/agent package.

Frequently Asked Questions about openrouter-agent-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate TypeScript code from @openrouter/sdk to @openrouter/agent?

To migrate TypeScript code from @openrouter/sdk to @openrouter/agent, update import paths for callModel, tool(), stop conditions, format converters, and type definitions, then install the new standalone package.

What import mappings are needed for the OpenRouter agent package migration?

The OpenRouter agent package migration requires updating before and after import paths for agent-related exports including callModel usage, tool creation, stop condition imports, and format converter updates.

Can I use @openrouter/sdk and @openrouter/agent in the same TypeScript project?

Yes, you can use both packages in the same TypeScript project by keeping @openrouter/sdk for non-agent features like model listing, credits, and OAuth, while using @openrouter/agent for agent functionality.

What new features are available in @openrouter/agent compared to the legacy SDK?

The @openrouter/agent package introduces agent-only capabilities like shared context schemas, tool approval flows, and turn lifecycle callbacks that are not available in the legacy @openrouter/sdk package.

What's the best way to update callModel usage during the OpenRouter agent migration?

The best way to update callModel usage is to apply the exact before and after import path mappings provided by the migration guide, ensuring all references point to the new @openrouter/agent package.

Why do my TypeScript imports break after splitting OpenRouter agent functionality?

TypeScript imports break because agent functionality was split into a separate package, requiring you to update dozens of import paths and package references from @openrouter/sdk to @openrouter/agent.