# Run a first AI-Model-Wrapper-for-OpenAI example

Start with the smallest workflow described by the README for **AI-Model-Wrapper-for-OpenAI**. Complete [installation and configuration](/docs/up-to-code-ai-model-wrapper-for-openai/installation-guide) first.

## Quick Start

### 1. Basic Setup

```typescript
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

```bash
# .env file
OPENROUTER_API_KEY=your_openrouter_key_here
OPENAI_API_KEY=your_openai_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here
```

```typescript
// Create from environment variables
const ai = AIModel.createFromEnv('openrouter', {
  temperature: 0.7,
  maxTokens: 1000
});
```

## Next task

[Read the usage guide](/docs/up-to-code-ai-model-wrapper-for-openai/usage-guide) for the documented components, configuration, and source layout.

## Source and help

- [GitHub repository](https://github.com/Up-to-code/AI-Model-Wrapper-for-OpenAI)
- [Original README](https://github.com/Up-to-code/AI-Model-Wrapper-for-OpenAI/blob/main/README.md)
- [Issues and existing reports](https://github.com/Up-to-code/AI-Model-Wrapper-for-OpenAI/issues)
