Usage for Agents

Add OpenRouter Agent SDK skills to your AI coding assistant

Give your AI coding assistant the knowledge to work with the OpenRouter Agent SDK by installing our official openrouter-typescript-sdk skill from the OpenRouterTeam/skills repository.

The skill covers both the Agent SDK (@openrouter/agent) and the Client SDKs (@openrouter/sdk). When working with the Agent SDK, your AI assistant will focus on the agent features: callModel, tool() definitions, stop conditions, streaming, and multi-turn conversations.

Quick Start

Claude Code

$/plugin marketplace add OpenRouterTeam/skills
$/plugin install openrouter@openrouter

Cursor

Add via Settings > Rules > Add Rule > Remote Rule (Github) with OpenRouterTeam/skills.

Skills CLI

Works with any supported agent (docs):

$npx skills add OpenRouterTeam/skills

Supported AI Coding Assistants

The skill works with any AI coding assistant that supports the Agent Skills standard:

AssistantStatus
Claude CodeSupported
CursorSupported
OpenCodeSupported
GitHub CopilotSupported
CodexSupported
AmpSupported
Roo CodeSupported
AntigravitySupported

What the Skill Provides

Once installed, your AI coding assistant will have knowledge of:

  • callModel API - The recommended approach for making AI model calls with full type safety and streaming support
  • Tool Definitions - Creating tools with the tool() helper and Zod schemas
  • Stop Conditions - Controlling agent loop termination with stepCountIs, maxCost, and more
  • Streaming - Real-time token output within agent steps
  • Multi-turn Conversations - Managing conversation state across turns
  • Dynamic Parameters - Changing model, temperature, or tools between turns

Example Usage

After installing the skill, your AI assistant can help you with tasks like:

“Help me set up an OpenRouter agent”

The assistant will know to use:

1import { callModel } from '@openrouter/agent';
2
3const response = await callModel({
4 model: 'anthropic/claude-sonnet-4',
5 messages: [
6 { role: 'user', content: 'Hello!' }
7 ]
8});

“Add a tool to my agent”

The assistant understands the tool pattern:

1import { callModel, tool } from '@openrouter/agent';
2import { z } from 'zod';
3
4const searchTool = tool({
5 name: 'search',
6 description: 'Search the web',
7 inputSchema: z.object({ query: z.string() }),
8 execute: async ({ query }) => {
9 return { results: ['...'] };
10 },
11});
12
13const result = await callModel({
14 model: 'anthropic/claude-sonnet-4',
15 messages: [{ role: 'user', content: 'Search for TypeScript best practices' }],
16 tools: [searchTool],
17});

Repository

The skill source is available at: github.com/OpenRouterTeam/skills

Contributions and feedback are welcome.