openrouter-typescript-sdk

Integrate 300+ AI models via a single TypeScript SDK.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/Selfdb-io/StreamX --skill openrouter-typescript-sdk-selfdb-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openrouter-typescript-sdk
Source: https://github.com/Selfdb-io/StreamX/tree/main/.agentone/skills/openrouter-typescript-sdk
Command: npx skills add https://github.com/Selfdb-io/StreamX --skill openrouter-typescript-sdk-selfdb-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of integrating 300+ AI models through a single, type-safe TypeScript SDK, delivering a unified callModel pattern to simplify AI agent development.

Core Features & Use Cases

  • Unified TypeScript SDK: Access 300+ AI models through a single, type-safe API.
  • Deterministic Tool Usage & Streaming: Supports multi-turn conversations with streaming responses and built-in tool execution.
  • Production-Ready Patterns: Includes authentication methods (API keys and OAuth PKCE), model formatting, and format conversion helpers.

Quick Start

Install the SDK with npm install @openrouter/sdk. Create a client by initializing with your API key from OpenRouter settings. Example: import OpenRouter from '@openrouter/sdk'; const client = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY }); Then call client.callModel with a model and input.

Frequently Asked Questions about openrouter-typescript-sdk

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

FAQPage Schema
How do I call multiple AI models from a single TypeScript SDK?

To call multiple AI models from a single TypeScript SDK, install the OpenRouter package and use the deterministic callModel pattern to access 300+ models through a unified, type-safe API.

How do I implement streaming responses for AI agents in TypeScript?

Implement streaming responses for AI agents by configuring the TypeScript SDK to support multi-turn conversations with built-in tool execution and streaming response delivery.

Can I use OAuth PKCE to authenticate AI model calls in a browser environment?

Yes, you can use OAuth PKCE to authenticate AI model calls in a browser environment, as the SDK supports secure authentication alongside standard API keys for client-side or server-side use.

What is the best way to integrate 300+ AI models into a Node.js application?

The best way to integrate 300+ AI models into a Node.js application is using a unified TypeScript SDK that provides format conversion helpers and a single callModel interface for deterministic tool usage.

Do I need an OpenRouter API key to use the callModel function?

Yes, you need an OpenRouter API key initialized in the client constructor to authorize callModel requests, or you must implement the OAuth PKCE flow for secure authentication.