Get Started
Run a first AI-Model-Wrapper-for-OpenAI example
Run a first AI-Model-Wrapper-for-OpenAI example: A clean, TypeScript-based wrapper for the OpenAI API with built-in conversation management, streaming support, and optional debug logging.
Start with the smallest workflow described by the README for AI-Model-Wrapper-for-OpenAI. Complete installation and configuration first.
Quick Start
1. Basic Setup
import { AIModel } from './ai-model-lib';
// Simplest usage with OpenRouter (free tier available)
const ai = new AIModel({
apiKey: 'your-api-key-here',
provider: 'openrouter',
debug: true
});
// Send a message and get response
const response = await ai.sendTextMessage('Hello, how are you?');
console.log(response.content);2. Environment Variables Setup
# .env file
OPENROUTER_API_KEY=your_openrouter_key_here
OPENAI_API_KEY=your_openai_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here// Create from environment variables
const ai = AIModel.createFromEnv('openrouter', {
temperature: 0.7,
maxTokens: 1000
});Next task
Read the usage guide for the documented components, configuration, and source layout.
Source and help
Source captured: 2026-10-11
