npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@atrix.dev/ai-voice-sdk

v1.0.7

Published

AI Voice Caller SDK - Create AI-powered voice calls with ease

Readme

AI Voice Caller SDK

Create AI-powered voice calls with natural language processing and voice synthesis.

Features

| Category | Features | |----------|----------| | Voice Calls | • Outbound calls• SMS messaging• Real-time call monitoring• Call status tracking• Concurrent call handling | | AI Integration | • Natural voice synthesis• Multi-voice support• Emotion detection• Conversation management• Context awareness | | Analytics | • Call metrics tracking• Cost monitoring• Success rate analysis• Duration tracking• Sentiment analysis | | Developer Tools | • WebSocket monitoring• Caching system• Rate limiting• Health checks• Detailed logging |

Installation

npm install @atrix.dev/ai-voice-sdk

Quick Start

import { AIVoiceCaller } from '@atrix.dev/ai-voice-sdk';

// Initialize the SDK
const voiceCaller = new AIVoiceCaller({
  apiKey: 'your_api_key',
  twilioAccountSid: 'your_twilio_sid',
  twilioAuthToken: 'your_twilio_token',
  twilioPhoneNumber: 'your_twilio_number',
  elevenLabsApiKey: 'your_elevenlabs_key',
  elevenLabsVoiceId: 'your_voice_id'
});

// Make a call
const result = await voiceCaller.makeCall({
  to: '+1234567890',
  message: 'Hello from AI Voice!'
});

// Send an SMS
const sms = await voiceCaller.sendSMS(
  '+1234567890', 
  'Hello from AI Voice!'
);

Configuration Options

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | apiKey | string | ✓ | - | Your Atrix API key | | twilioAccountSid | string | ✓ | - | Twilio Account SID | | twilioAuthToken | string | ✓ | - | Twilio Auth Token | | twilioPhoneNumber | string | ✓ | - | Your Twilio phone number | | elevenLabsApiKey | string | ✓ | - | ElevenLabs API key | | elevenLabsVoiceId | string | ✓ | - | ElevenLabs voice ID | | baseUrl | string | - | https://api.atrix.dev | API base URL | | logLevel | string | - | 'info' | Logging level (debug/info/warn/error) | | maxConcurrentCalls | number | - | 5 | Maximum concurrent calls | | cacheTTL | number | - | 300000 | Cache TTL in milliseconds | | cacheMaxSize | number | - | 1000 | Maximum cache entries | | retryAttempts | number | - | 3 | Number of retry attempts | | timeout | number | - | 30000 | Request timeout in milliseconds |

API Reference

Voice Calls

// Make a voice call
const call = await voiceCaller.makeCall({
  to: '+1234567890',
  message: 'Hello!',
  voiceSettings: {
    stability: 0.7,
    similarityBoost: 0.5,
    style: 0.5,
    useSpeakerBoost: true
  }
});

// End a call
await voiceCaller.endCall('call_id');

// Get call history
const history = await voiceCaller.getCallHistory(10);

// Get call metrics
const metrics = await voiceCaller.getCallMetrics('call_id');

SMS Messaging

// Send SMS
const sms = await voiceCaller.sendSMS(
  '+1234567890',
  'Hello from AI Voice!'
);

Real-time Monitoring

// Listen for call status updates
voiceCaller.onCallStatus((status) => {
  console.log('Call status:', status);
});

// Listen for errors
voiceCaller.onError((error) => {
  console.error('Error:', error);
});

Analytics & Metrics

// Get aggregate metrics
const metrics = await voiceCaller.getMetrics();

// Get conversation transcript
const transcript = await voiceCaller.getConversationTranscript('call_id', {
  format: 'json',
  includeTiming: true,
  speakerLabels: true
});

Error Handling

| Error Code | Description | Common Causes | |------------|-------------|---------------| | INVALID_CONFIG | Configuration error | Missing required fields, invalid format | | TWILIO_ERROR | Twilio API error | Invalid credentials, rate limits | | ELEVENLABS_ERROR | ElevenLabs API error | Invalid API key, voice ID | | NETWORK_ERROR | Network request failed | Timeout, connection issues | | CALL_FAILED | Call operation failed | Invalid phone number, service unavailable | | SMS_FAILED | SMS operation failed | Invalid phone number, service unavailable | | VALIDATION_ERROR | Input validation failed | Invalid phone format, missing data |

Best Practices

  1. Rate Limiting

    • Monitor your API usage
    • Implement proper error handling
    • Use the built-in rate limiter
  2. Resource Management

    • Clean up resources with disconnect()
    • Monitor memory usage with metrics
    • Use caching for frequent requests
  3. Error Handling

    • Always implement error handlers
    • Use try-catch blocks
    • Monitor error rates
  4. Performance

    • Enable caching for repeated calls
    • Use concurrent call limits
    • Monitor call metrics

Examples

Advanced Call Setup

const call = await voiceCaller.makeCall({
  to: '+1234567890',
  message: 'Hello!',
  voiceSettings: {
    stability: 0.7,
    similarityBoost: 0.5,
    style: 0.5,
    useSpeakerBoost: true
  },
  webhookEvents: ['initiated', 'ringing', 'answered', 'completed'],
  callbackUrl: 'https://your-webhook.com/callback'
});

Health Monitoring

// Check service health
const isHealthy = await voiceCaller.checkHealth();

// Clear cache if needed
await voiceCaller.clearCache();

// Disconnect services
voiceCaller.disconnect();

Support

License

MIT