
Openrouter Typescript Sdk
Complete callModel-based reference for the OpenRouter TypeScript SDK, covering text generation, OAuth, and key management.
- CCM score
- 46 of 100
- skills.sh installs
- 2K
- GitHub stars
- 29
- last updated
- Jul 14, 2026
Own this skill? Claim it
What it does
- Covers installation, client setup, and the
callModelpattern for accessing 300+ models through one interface - Includes API key management (
apiKeys.list,create,get,update,delete) and an OAuth PKCE flow viacreateAuthCodeandexchangeAuthCodeForAPIKey - Provides input formats for string prompts, multi-turn message arrays, and multimodal content, with streaming and tool execution noted as supported
- Designed for server-side apps that need an API key and for user-facing apps that obtain per-user keys through OAuth
Install
$ npx -y skills add openrouterarchived/agent-skills --skill openrouter-typescript-sdk -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
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
npm install @openrouter/sdk
Setup
Get your API key from openrouter.ai/settings/keys, then initialize:
import OpenRouter from '@openrouter/sdk';
const client = new OpenRouter({
apiKey: process.env.OPENROUTER_API_KEY
});
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
- Visit openrouter.ai/settings/keys
- Create a new API key
- Store securely in an environment variable
Environment Setup
export OPENROUTER_API_KEY=sk-or-v1-your-key-here
Client Initialization
Details
- Repository
- github.com/openrouterarchived/agent-skills
- Categories
- AI Agents & LLM Apps, Backend & APIs
More from openrouterarchived/agent-skills
All 2Similar to Openrouter Typescript Sdk
More AI Agents & LLM Apps
create-agentSkillopenrouterarchived/agent-skills2.7K installsBootstrap a modular AI agent core with OpenRouter SDK, lifecycle hooks, and optional Ink terminal UI.
Mcp Ts TemplateMCP servercyanheads155 starsTyped TypeScript framework for building MCP servers with auth, storage, logging, and transports.
mcp-builderSkillanthropics/skills143.3K installsGuide for building MCP servers that let LLMs call external APIs through well-designed, agent-friendly tools.
pinme-llmSkillglitternetwork/pinme510 installsWorker-side OpenRouter access through PinMe's proxy, covering models, chat completions, streaming, and web search.
appwrite-typescriptSkillappwrite/skills1.1K installsTyped TypeScript SDK guide for Appwrite covering web, React Native, and Node.js/Deno clients and server-side admin.
chatgpt-codex-onboardingSkillstarchild-ai-agent/official-skills2.5K installsSecure device-code sign-in that connects a ChatGPT or Codex subscription for model access without an API key.