openrouter-typescript-sdk

Integrate 300+ AI models via a type-safe TypeScript SDK with Zod tool schemas and streaming outputs.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/Zemelware/Lucid --skill openrouter-typescript-sdk-zemelware
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openrouter-typescript-sdk
Source: https://github.com/Zemelware/Lucid/tree/main/.agents/skills/openrouter-typescript-sdk
Command: npx skills add https://github.com/Zemelware/Lucid --skill openrouter-typescript-sdk-zemelware

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @types/node, zod.

What problem does it solve?

This Skill consolidates the complexity of using OpenRouter by exposing a single, type-safe TypeScript SDK through the callModel pattern.

Core Features & Use Cases

  • Type-safe model calls with IDE autocomplete and broad model coverage (300+ models)
  • Unified access to chat, tools, streaming, and multi-turn conversations via a single API
  • Quick integration into apps for building chatbots, automation agents, and intelligent assistants

Quick Start

  1. Install the package: npm install @openrouter/sdk
  2. Initialize the client and make a model call: import OpenRouter from '@openrouter/sdk'; const client = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY }); // Example usage: await client.callModel({ model: 'openai/gpt-5-nano', input: 'Hello' });

Frequently Asked Questions about openrouter-typescript-sdk

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

FAQPage Schema
How do I integrate multiple AI models into a TypeScript application?

Integrate multiple AI models in TypeScript by using a single type-safe SDK to access 300+ models via OpenRouter. The callModel workflow enforces type safety, handles errors, and streams outputs for chatbots and agents.

How do I enforce type-safe tool schemas when calling AI models?

Enforce type-safe tool schemas by defining tool inputs with Zod. The SDK validates deterministic inputs within the callModel workflow, ensuring robust type checking and IDE autocomplete when executing multi-turn agent tasks.

Can I use streaming responses with a TypeScript AI SDK?

Yes, you can use streaming responses with this TypeScript AI SDK. It supports streaming outputs across 300+ models, allowing real-time data delivery for chat interfaces and automated agent workflows.

What is the best way to call OpenRouter models from a Node.js environment?

The best way to call OpenRouter models from Node.js is using a type-safe TypeScript SDK. Initialize the client with your API key and execute the callModel function for unified access to chat and multi-turn agents.

Do I need Zod to build multi-turn agents with this SDK?

Yes, Zod is required to build multi-turn agents with this SDK. It provides the schema validation necessary to enforce deterministic, type-safe tool inputs within the callModel workflow.