Agent skill · software engineering · openrouterteam

openrouter-typescript-sdk

Complete reference for integrating with 300+ AI models through the OpenRouter TypeScript SDK using the callModel pattern

Why this skill is useful

Provides specific TypeScript SDK commands and patterns for integrating with OpenRouter's API that the AI wouldn't reliably generate on its own.

What it needs

Requires @openrouter/sdk installed locally. Requires openrouter account access. About 10k tokens when loaded. Last updated 2026-01-31. 29 stars on the source repository.

What this skill does

OpenRouter TypeScript SDK A comprehensive TypeScript SDK for interacting with OpenRouter's unified API, providing access to 300+ AI models through a single, type-safe interface. This skill enables AI agents to leverage the callModel pattern for text generation, tool usage, streaming, and multi-turn conversations. --- Installation Setup Get your API key from openrouter.ai/settings/keys, then initialize: --- Authentication The SDK supports two authentication methods: API keys for server-side applications and OAuth PKCE flow for user-facing applications. API Key Authentication The primary authentication method uses API keys from your OpenRouter account. Obtaining an API Key 1. Visit openrouter.ai/settings/keys 2. Create a new API key 3. Store securely in an environment variable Environment Setup Client Initialization The client automatically uses this key for all subsequent requests: Get Current Key Metadata Retrieve information about the currently configured API key: API Key Management Programmatically manage API keys: OAuth Authentication (PKCE Flow) For user-facing applications where users should control their own API keys, OpenRouter supports OAuth with PKCE (Proof Key for Code Exchange). This flow allows users to generate API keys through a browser authorization flow without your application handling their credentials. createAuthCode Generate an authorization code and URL to start the OAuth flow: Parameters: Parameter Type Required Description ----------- ------ ---------- ------------- callbackUrl string Yes Your application's callback URL after user authorization Browser Redirect: exchangeAuthCodeForAPIKey After the user authorizes your application, they are redirected back to your callback URL with an authorization code. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills openrouterteam/typescript-sdk

View the source on GitHub

Browse the @skills marketplace