Getting Started
Get up and running with Mozaik in just a few minutes.
Installation
Install Mozaik using your preferred package manager:
terminal
1# Using yarn2yarn add @mozaik-ai/core34# Using npm5npm install @mozaik-ai/core67# Using pnpm8pnpm add @mozaik-ai/core
Configuration
Create a .env file in your project root with your API keys:
.env
1OPENAI_API_KEY=your-openai-key-here2ANTHROPIC_API_KEY=your-anthropic-key-here
Tip
You only need to configure the API keys for the providers you plan to use. Mozaik supports both OpenAI and Anthropic models.
Supported Models
OpenAI
- • gpt-5
- • gpt-5-mini
- • gpt-5-nano
- • gpt-5.1
Anthropic
- • claude-sonnet-4.5
- • claude-haiku-4.5
- • claude-opus-4.5
Create Your First Agent
Here's a simple example to create and run your first AI agent:
index.ts
1import { MozaikAgent, MozaikRequest } from '@mozaik-ai/core'23// Define your command4const request: MozaikRequest = {5 model: 'gpt-5'6}78// Create the agent9const agent = new MozaikAgent(request)1011// Run the agent with a task12const response = await agent.act('Write a haiku about TypeScript')1314console.log(response)
Switching Providers
Mozaik provides a unified API across providers. Simply change the model name to switch:
providers.ts
1import { MozaikAgent, MozaikRequest } from '@mozaik-ai/core'23// Using OpenAI4const openaiAgent = new MozaikAgent({ model: 'gpt-5' })56// Using Anthropic7const claudeAgent = new MozaikAgent({ model: 'claude-sonnet-4.5' })89// Both use the same API10const response1 = await openaiAgent.act('Hello!')11const response2 = await claudeAgent.act('Hello!')