openrouter-typescript-sdk

Integrate OpenRouter's TypeScript SDK to access 300+ AI models via callModel.

1|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/regybean/ChatGBeanT --skill openrouter-typescript-sdk-regybean
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openrouter-typescript-sdk
Source: https://github.com/regybean/ChatGBeanT/tree/main/.agents/skills/openrouter-typescript-sdk
Command: npx skills add https://github.com/regybean/ChatGBeanT --skill openrouter-typescript-sdk-regybean

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables developers to integrate with OpenRouter's TypeScript SDK to access 300+ AI models through a single, type-safe callModel interface, eliminating boilerplate and manual model wiring.

Core Features & Use Cases

  • Type-safe interface: Strongly typed callModel usage with IDE autocomplete and OpenAPI-generated model types.
  • Streaming & multi-turn support: Consume responses incrementally and orchestrate tool calls in multi-turn conversations.
  • Tooling ecosystem: Define and invoke tools with zod schemas, including dynamic parameter adjustments and stop conditions.
  • Dynamic parameters: Compute model selection and behavior based on conversation context.
  • Real-world use cases: Build AI agents, automated workflows, and interactive assistants in TypeScript projects.

Quick Start

Install the SDK with npm install @openrouter/sdk, then initialize the client using your API key:

  • Create a client: import OpenRouter from '@openrouter/sdk'; const client = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });

Frequently Asked Questions about openrouter-typescript-sdk

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

FAQPage Schema
How do I access multiple AI models in a TypeScript project without manual wiring?

You can access 300+ AI models through a single, type-safe callModel interface using the OpenRouter TypeScript SDK, eliminating boilerplate and manual model wiring in Node.js environments.

Does the OpenRouter TypeScript SDK support streaming responses for AI agents?

Yes, the OpenRouter TypeScript SDK supports streaming responses, allowing you to consume AI model outputs incrementally and orchestrate tool calls in multi-turn conversations.

How do I define and invoke tools with type safety in TypeScript?

You define and invoke tools using zod schemas to enforce type-safe parameters, which enables dynamic parameter adjustments and stop conditions during multi-turn AI conversations.

Can I dynamically compute model selection based on conversation context?

Yes, the SDK allows you to compute model selection and adjust behavior dynamically based on conversation context, ensuring flexible AI model integration for interactive assistants.

What is the best way to integrate OpenAI-driven model types in a Node.js workflow?

The best way is using the OpenRouter SDK's OpenAPI-generated model types, which provide strongly typed callModel usage with IDE autocomplete for building automation workflows.

What are the limitations of using a single callModel interface for 300+ models?

While the callModel interface unifies access to 300+ models, you must still handle dynamic parameter evaluation, tool orchestration, and type-safe parameters to manage edge cases effectively.