Getting Started

Get up and running with Mozaik in just a few minutes.

Installation

Install Mozaik using your preferred package manager:

terminal
1# Using yarn
2yarn add @mozaik-ai/core
3
4# Using npm
5npm install @mozaik-ai/core
6
7# Using pnpm
8pnpm add @mozaik-ai/core

Configuration

Create a .env file in your project root with your API keys:

.env
1OPENAI_API_KEY=your-openai-key-here
2ANTHROPIC_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'
2
3// Define your command
4const request: MozaikRequest = {
5 model: 'gpt-5'
6}
7
8// Create the agent
9const agent = new MozaikAgent(request)
10
11// Run the agent with a task
12const response = await agent.act('Write a haiku about TypeScript')
13
14console.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'
2
3// Using OpenAI
4const openaiAgent = new MozaikAgent({ model: 'gpt-5' })
5
6// Using Anthropic
7const claudeAgent = new MozaikAgent({ model: 'claude-sonnet-4.5' })
8
9// Both use the same API
10const response1 = await openaiAgent.act('Hello!')
11const response2 = await claudeAgent.act('Hello!')

Next Steps