DEVELOPER SDK

Pinecall SDK

Build powerful voice AI applications with our comprehensive developer tools

pinecall-example.js
1import { Pinecall } from '@pinecall/sdk';
2
3// Initialize the Pinecall client
4const pinecall = new Pinecall({
5 apiKey: process.env.PINECALL_API_KEY
6});
7
8// Create a new AI agent
9async function createVoiceAgent() {
10 const agent = await pinecall.agents.create({
11 name: 'Customer Support Agent',
12 voice: 'alex',
13 language: 'en-US',
14 prompt: `You are a helpful customer support agent for Acme Inc.
15 Be friendly, professional, and solve customer problems efficiently.`
16 });
17
18 // Assign a phone number to the agent
19 const phoneNumber = await pinecall.phoneNumbers.assign({
20 agentId: agent.id,
21 areaCode: '415' // San Francisco area code
22 });
23
24 console.log(`Agent created with ID: ${agent.id}`);
25 console.log(`Phone number assigned: ${phoneNumber.number}`);
26
27 return { agent, phoneNumber };
28}
29
30// Make an outbound call with the agent
31async function makeOutboundCall(agentId, customerNumber) {
32 const call = await pinecall.calls.create({
33 agentId: agentId,
34 to: customerNumber,
35 recordCall: true,
36 transcribeCall: true,
37 callbackUrl: 'https://your-server.com/call-events'
38 });
39
40 console.log(`Call initiated with ID: ${call.id}`);
41 return call;
42}
43
44// Execute the example
45createVoiceAgent().then(({ agent }) => {
46 makeOutboundCall(agent.id, '+14155551234');
47});

Phone Numbers

Buy, manage, and configure phone numbers programmatically. Assign numbers to AI agents and access call logs, recordings, and analytics.

AI Agents

Create and customize AI agents with natural voices and personalities. Deploy across multiple channels with advanced conversation capabilities.

LangChain Integration

Leverage LangChain's powerful capabilities for advanced AI workflows. Connect with multiple LLMs and create sophisticated conversation chains.

Inbound Calls

Handle incoming calls with intelligent routing and custom greetings. Set up automated workflows and call queues.

Outbound Calls

Trigger automated outbound calls for notifications and follow-ups. Manage call scheduling and campaign automation.

Real-Time Updates

Get instant updates on call status, transcriptions, and recordings. Monitor agent performance and conversation quality.

Web.js

Build real-time voice and video applications with our web SDK. Integrate voice AI directly into your web applications.

Analytics API

Access detailed analytics and insights about your voice interactions. Track performance metrics and optimize your voice applications.

Detailed Capabilities

Phone Numbers

  • Buy and manage phone numbers programmatically with the SDK

  • Assign and reassign phone numbers to different LLM agents

  • Retrieve phone number resources like call logs, contacts, messages, and recordings

AI Agents

  • Create and manage AI agents programmatically for various use cases

  • Customize agent voices, accents, and speech patterns for more natural interactions

  • Deploy agents across multiple channels like phone, web, and messaging platforms

LangChain Integration

  • Integrate with LangChain's ecosystem for advanced language model capabilities

  • Build sophisticated conversation chains and memory systems

  • Access multiple LLMs and tools through a unified interface for enhanced AI interactions

Inbound Calls

  • Receive inbound calls and route them to the right LLM agent

  • Set up and manage custom greetings, hold messages and audios

  • Automate call routing via prompts

Outbound Calls

  • Trigger outbound calls directly from your applications or CRM

  • Automate outbound calls for follow-ups and notifications

  • Manage call queues and scheduling

Real-Time Updates

  • Get real-time updates on incoming and outbound calls

  • Access live transcriptions and recordings

  • Manage contact information and recent interactions for follow-up actions

Available SDKs

JavaScript
Python
Node.js
React
TypeScript

Ready to Build with Pinecall?

Get started with our developer-friendly APIs and SDKs to create powerful voice AI applications