For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
    • Overview
    • Usage for Agents
  • TypeScript SDK
    • Overview
  • Python SDK
    • Overview
  • Go SDK
  • DevTools
    • Overview
    • Migrating to @openrouter/agent
LogoLogo
ModelsChatRankingsDocs
On this page
  • Quick Start
  • Claude Code
  • Cursor
  • GitHub CLI
  • Supported AI Coding Assistants
  • What the Skill Provides
  • Example Usage
  • Repository

Usage for Agents

Add OpenRouter Client SDKs skills to your AI coding assistant
Was this page helpful?
Previous

TypeScript SDK

Official OpenRouter TypeScript SDK documentation
Next
Built with

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

The skill covers both the Client SDKs (@openrouter/sdk) and the Agent SDK (@openrouter/agent). When working with the Client SDKs, your AI assistant will focus on the platform features: model listing, chat completions, credits, OAuth, and API key management.

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.

GitHub CLI

Requires GitHub CLI v2.90.0+. Works with Claude Code, Cursor, OpenCode, Codex, Gemini CLI, Windsurf, and many more agents:

$gh skill install OpenRouterTeam/skills openrouter-typescript-sdk

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:

  • SDK Installation & Setup - How to install and configure @openrouter/sdk in TypeScript projects
  • Chat Completions - Working with the chat API for conversations
  • Embeddings - Generating embeddings for semantic search and RAG
  • Error Handling - Proper error handling patterns
  • Streaming - Real-time streaming responses
  • Tool Use - Implementing function calling and tools
  • API Key Management - Programmatic API key creation and management
  • OAuth - PKCE authentication flow for user-facing applications

Example Usage

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

“Help me set up OpenRouter in my project”

The assistant will know to use:

1import OpenRouter from '@openrouter/sdk';
2
3const client = new OpenRouter();
4
5const completion = await client.chat.send({
6 model: 'anthropic/claude-sonnet-4',
7 messages: [
8 { role: 'user', content: 'Hello!' }
9 ]
10});

“Add streaming to my OpenRouter call”

The assistant understands the streaming API:

1import OpenRouter from '@openrouter/sdk';
2
3const client = new OpenRouter();
4
5const stream = await client.chat.send({
6 model: 'anthropic/claude-sonnet-4',
7 messages: [{ role: 'user', content: 'Tell me a story' }],
8 stream: true
9});
10
11for await (const chunk of stream) {
12 process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
13}

If you need higher-level primitives for building agents — multi-turn loops, tool definitions, stop conditions — see the Agent SDK instead.

Repository

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

Contributions and feedback are welcome.