This guide walks you through building with Smallest AI using the official Node.js SDK.
For full details, see the Node SDK on GitHub.


1. Installation

Install the SDK using npm:

npm install smallestai

2. Get Your API Key

  1. Go to the Smallest AI Console and sign up or log in.
  2. Navigate to the API Keys tab and create a new API key.
  3. Store your key securely (e.g., as SMALLEST_API_KEY in your environment).

3. Create Your First Agent

Create an agent with a display name, voice, and language:

import { Configuration, AtomsClient } from 'smallestai';

const config = new Configuration({
  accessToken: 'your-api-key'
});
const atomsClient = new AtomsClient(config);

// Create your first agent
const agent = await atomsClient.createAgent({
  displayName: "My First Agent",
  voiceId: "emily", // or any available voice
  language: "en"
});
console.log("Created agent:", agent);

4. Place an Outbound Call

Place a call using your agent to a phone number:

const call = await atomsClient.placeCall({
  agentId: agent.id,
  phoneNumber: "+1234567890"
});
console.log("Placed call:", call);

5. Provide Context to the Agent

Optionally, provide context to your agent for personalized conversations:

const context = {
  customerName: "Alice",
  orderId: "12345"
};
const response = await atomsClient.updateAgentContext({
  agentId: agent.id,
  context
});
console.log("Updated agent context:", response);

6. Bulk Calling / Campaigns

Provision bulk calling using campaigns:

const campaign = await atomsClient.createCampaign({
  agentId: agent.id,
  phoneNumbers: ["+1234567890", "+1987654321"]
});
console.log("Created campaign:", campaign);

For more details and advanced usage, see the Node SDK Repository.