Developer Platform

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/sdk

Python

Python 3.8+

pip install karmasai

REST 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.

agent.ts
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.

outbound.py
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

POST/v1/agentsCreate a new AI agent
GET/v1/agents/:idRetrieve agent details
POST/v1/calls/initiateInitiate an outbound call
GET/v1/calls/:idGet call details and transcript
POST/v1/knowledge-basesCreate a knowledge base
POST/v1/knowledge-bases/:id/documentsUpload documents
GET/v1/analytics/callsQuery call analytics
POST/v1/webhooksRegister a webhook endpoint

Real-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.started
call.ended
call.transferred
call.recording.ready
agent.created
agent.updated
campaign.completed
knowledge_base.synced

Start building today

Get your API key and deploy your first AI voice agent in minutes.