Build with Karmas AI
RESTful API, webhooks, and SDKs for Node.js and Python. Everything you need to integrate AI voice agents into your application.
Getting Started
Up and running in minutes
1. Get your API key
Sign up for a free account and generate your API key from the dashboard settings.
2. Install the SDK
Install the SDK for your language of choice. We support Node.js and Python with more coming soon.
3. Make your first call
Create an agent, assign a phone number, and your AI is ready to handle calls.
SDKs & Libraries
Choose your language
Node.js
TypeScript / JavaScript
npm install @karmasai/sdkPython
Python 3.8+
pip install karmasaiREST API
Any language
curl https://api.karmas.ai/v1/Node.js Example
Create an agent in 10 lines
Our SDK makes it simple to create agents, assign phone numbers, and start handling calls programmatically.
import { KarmasAI } from '@karmasai/sdk';
const karmas = new KarmasAI({
apiKey: process.env.KARMAS_API_KEY,
});
// Create an agent
const agent = await karmas.agents.create({
name: 'Reception Agent',
voice: 'alloy',
language: 'en-US',
systemPrompt: `You are a friendly receptionist for
Acme Dental. Help callers book appointments,
answer questions, and take messages.`,
knowledgeBaseId: 'kb_123',
tools: ['calendar_booking', 'sms_notification'],
});
// Assign a phone number
await karmas.phoneNumbers.assign({
agentId: agent.id,
number: '+14155551234',
});
// Listen for call events
karmas.webhooks.on('call.ended', async (event) => {
console.log('Call summary:', event.data.summary);
console.log('Sentiment:', event.data.sentiment);
console.log('Duration:', event.data.duration);
});Python Example
Outbound calls made easy
Initiate outbound calls with context, get transcripts, and analyze results programmatically.
from karmasai import KarmasAI
karmas = KarmasAI(api_key="your-api-key")
# Initiate an outbound call
call = karmas.calls.create(
agent_id="agent_abc123",
to="+14155551234",
context={
"customer_name": "John Smith",
"appointment_date": "2025-03-15",
"reason": "appointment_reminder"
}
)
# Get call results
result = karmas.calls.get(call.id)
print(f"Status: {result.status}")
print(f"Duration: {result.duration}s")
print(f"Transcript: {result.transcript}")API Reference
RESTful API endpoints
Full CRUD operations for agents, calls, knowledge bases, and more
/v1/agentsCreate a new AI agent/v1/agents/:idRetrieve agent details/v1/calls/initiateInitiate an outbound call/v1/calls/:idGet call details and transcript/v1/knowledge-basesCreate a knowledge base/v1/knowledge-bases/:id/documentsUpload documents/v1/analytics/callsQuery call analytics/v1/webhooksRegister a webhook endpointReal-time webhooks
Get notified instantly when calls start, end, get transferred, or when recordings are ready. Build reactive workflows that respond to call events in real-time.
Webhooks are delivered with retry logic and include HMAC signatures for verification.
call.startedcall.endedcall.transferredcall.recording.readyagent.createdagent.updatedcampaign.completedknowledge_base.syncedStart building today
Get your API key and deploy your first AI voice agent in minutes.